com.hedgehog.model
Interface ModelObject

All Known Implementing Classes:
AbstractGrid3D, AbstractPlanet, AdjacentIndexPolygon2D, AdjacentIndexTetrahedron3D, AlgebraicSurface3D, AlgebraicSurfaceTerm, AxisAlignedBox2D, AxisAlignedBox3D, AxisAlignedRectangle3D, BackgroundGrid2D, BackgroundGrid3D, BernoulliPolynomial, Box2D, Box3D, BSplineCurve3D, BSplineSurface3D, Circle2D, CircularArc2D, CircularDisk2D, CircularPieChord2D, Cone3D, ConvexQuadrilateral2D, ConvexStraightEdgePlanarPolygon3D, ConvexStraightEdgePolygon2D, CoonsSurface3D, CubicSplineSurface3D, Curve2D, Curve3D, Cylinder3D, Earth, EdgeAdjacentPolygon2DGraphMesh, EdgeAdjacentTriangle2DGraphMesh, Ellipse2D, Ellipsoid3D, EquilateralTriangle2D, FunctionSurface3D, GeometricObject, GeometricObject2D, GeometricObject3D, GeometricObjectBackgroundGrid2D, GeometricObjectBackgroundGrid3D, Graph, GraphTreeNode, Grid2D, Grid3D, Hexahedron3D, HorizontalLine2D, HorizontalLine3D, IndexObject2D, IndexObject3D, IndexObjectBackgroundGrid2D, IndexPoint2D, IndexPoint2DSet, IndexPoint3D, IndexPoint3DSet, IndexPointBackgroundGrid2D, IndexPointObject2D, IndexPointObject3D, IndexPolygon2D, IndexPolygon3D, IndexPolygonBackgroundGrid2D, IndexPolygonMesh2D, IndexQuadrilateral2D, IndexQuadrilateral3D, IndexStraightLine2D, IndexStraightLine3D, IndexTetrahedron3D, IndexTetrahedronBackgroundGrid3D, IndexTriangle2D, IndexTriangle3D, IndexTriangleBackgroundGrid2D, IndexTriangleBackgroundGrid3D, InfiniteStraightLine2D, InfiniteStraightLine3D, Jupiter, LevelSetGrid3D, LinearLine2D, Mars, Mercury, Mesh2D, ModelBoolean, ModelByte, ModelDouble, ModelInteger, ModelString, Moon, Neptune, NonRationalBezierCurve3D, NonRationalBezierSurface3D, NonRationalBSplineCurve3D, NonRationalBSplineSurface3D, NVariablePolynomial, NVariableTerm, ObjectBackgroundGrid2D, ObjectBackgroundGrid3D, OblateSpheroid3D, OneVariableCubicPolynomial, OneVariableLinearPolynomial, OneVariablePolynomial, OneVariableQuadraticPolynomial, OneVariableQuarticPolynomial, OneVariableTerm, OrthogonalCartesianPoint2D, OrthogonalCartesianPoint3D, ParallelXYPlane3D, ParallelXZPlane3D, ParallelYZPlane3D, ParametricLine2D, PlanarCircle3D, PlanarEllipse3D, PlanarFacePolyhedron3D, PlanarPolygon3D, Plane3D, Plane3DWithLocalAxes, Point2D, Point2DMatrix, Point2DSet, Point2DWithAdjacentPoints, Point3D, Point3DMatrix, Point3DSet, Point3DWithAdjacentPoints, Point3DWithScalar, PointBackgroundGrid2D, PointBackgroundGrid3D, PolyCurve2D, PolyCurve3D, Polygon2D, Polygon3D, Polyhedron3D, PolyStraightLine2D, PolyStraightLine3D, ProlateSpheroid3D, QuadraticShape2D, QuadraticSurface3D, Ray2D, Ray3D, Rectangle2D, Regular3Graph, Regular4Graph, RegularDodecahedron3D, RegularGraph, RegularHexagon2D, RegularHexahedron3D, RegularIcosahedron3D, RegularOctahedron3D, RegularPentagon2D, RegularPolygon2D, RegularPolyhedron3D, RegularTetrahedron3D, RightAngledCone3D, RightAngledCylinder3D, RightAngledFrustumCone3D, RuledConicSurface3D, RuledSurface3D, Saturn, Shape2D, Shape3D, SimplePolygonMesh2D, SimplePolygonMesh3D, Sphere3D, Spheroid3D, Square2D, StraightEdgePlanarFacePolyhedron3D, StraightEdgePlanarFaceTetrahedron3D, StraightEdgePlanarPolygon3D, StraightEdgePlanarQuadrilateral3D, StraightEdgePlanarTriangle3D, StraightEdgePolygon2D, StraightEdgeQuadrilateral2D, StraightEdgeTriangle2D, StraightLine2D, StraightLine3D, SuperEllipse2D, SuperEllipsoid3D, SuperQuadric3D, SuperToroid3D, Surface3D, SymbolicFunctionCurve2D, SymbolicFunctionSurface3D, SymbolicParametricCurve2D, SymbolicParametricSurface3D, Text, Torus3D, TwoVariablePolynomial, TwoVariableTerm, UndirectedGraph, UndirectedGraphTreeNode, Uranus, Vector2D, Vector3D, Vector3DWithRotation, Venus, VerticalLine2D, VerticalLine3D, WedgePentahedron3D, WeightedRationalBezierCurve3D, WeightedRationalBezierSurface3D, WeightedRationalBSplineCurve3D, WeightedRationalBSplineSurface3D

public interface ModelObject

Title: ModelObject - an interface for Model objects.

Description: Implemented by all classes that are objects of class Model.

Copyright: Copyright (c) Hedgehog Software.

Company: Hedgehog Software.

Since:
1.0
Version:
1.1

Method Summary
 java.util.Vector<ModelObject> childModelObjects()
          Returns a vector of this object's child ModelObject objects.
 java.sql.PreparedStatement databaseInsertStatement(java.sql.Connection connection, int modelID)
          Returns a prepared statement for inserting (INSERT command) a ModelObject object into a database.
 java.sql.PreparedStatement databaseUpdateStatement(java.sql.Connection connection, int modelID)
          Returns a prepared statement for updating (UPDATE command) a ModelObject object into a database.
 ModelObject fromDatabase(java.sql.Connection connection, Model model, int modelID, int objectID)
          Returns a model object from the specified database table.
 ModelObject fromXMLNode(org.w3c.dom.Document document, org.w3c.dom.Node documentRootNode, org.w3c.dom.Node node, Model model)
          Returns a model object from the specified xml node.
 X3DNode toX3DNode(X3DObject x3dObject)
          X3D support.
 org.w3c.dom.Element toXMLNode(org.w3c.dom.Document document, org.w3c.dom.Element documentRootNode)
          Returns the xml node of this object.
 

Method Detail

childModelObjects

java.util.Vector<ModelObject> childModelObjects()
Returns a vector of this object's child ModelObject objects.

Returns:
A vector consistng of this object's child ModelObject objects. If this object has no child ModelObjects then a non-null empty vector is returned.

databaseInsertStatement

java.sql.PreparedStatement databaseInsertStatement(java.sql.Connection connection,
                                                   int modelID)
                                                   throws java.sql.SQLException
Returns a prepared statement for inserting (INSERT command) a ModelObject object into a database.

Parameters:
connection - Database connection.
modelID - Model ID.
Returns:
A prepared statement for inserting a ModelObject object into a database.
Throws:
java.sql.SQLException - Thrown if an SQL exception occurs.

databaseUpdateStatement

java.sql.PreparedStatement databaseUpdateStatement(java.sql.Connection connection,
                                                   int modelID)
                                                   throws java.sql.SQLException
Returns a prepared statement for updating (UPDATE command) a ModelObject object into a database.

Parameters:
connection - Database connection.
modelID - Model ID.
Returns:
A prepared statement for inserting a ModelObject object into a database.
Throws:
java.sql.SQLException - Thrown if an SQL exception occurs.

fromDatabase

ModelObject fromDatabase(java.sql.Connection connection,
                         Model model,
                         int modelID,
                         int objectID)
                         throws java.sql.SQLException
Returns a model object from the specified database table.

Parameters:
connection - Database connection.
model - Model built from database.
modelID - Model ID.
objectID - Object ID in associated ModelObjects table.
Returns:
ModelObject corresponding to the specified db connection, model ID and obect ID. A null value is returned if no match found.
Throws:
java.sql.SQLException - Thrown if an SQL exception occurs.

toXMLNode

org.w3c.dom.Element toXMLNode(org.w3c.dom.Document document,
                              org.w3c.dom.Element documentRootNode)
                              throws InvalidObjectException
Returns the xml node of this object.

Parameters:
document - XML document.
documentRootNode - Document root node; ie Model node.
Returns:
The xml node of this object.
Throws:
InvalidObjectException - Thrown if this object's ID is equal to the default ID of -1.

fromXMLNode

ModelObject fromXMLNode(org.w3c.dom.Document document,
                        org.w3c.dom.Node documentRootNode,
                        org.w3c.dom.Node node,
                        Model model)
                        throws InvalidObjectException
Returns a model object from the specified xml node.

Parameters:
document - XML document.
documentRootNode - Document root node; ie Model node.
node - XML node.
model - Model to which node object is added.
Returns:
ModelObject corresponding to the specified node. A null value is returned if an error occurred building the object.
Throws:
InvalidObjectException - Thrown if an error occurred building the object.

toX3DNode

X3DNode toX3DNode(X3DObject x3dObject)
                  throws InvalidObjectException
X3D support.

Parameters:
x3dObject - X3D object.
Returns:
X3D object or null if object has no visualisation.
Throws:
InvalidObjectException - Thrown if this obejct is invalid.