org.jscience.ml.gml.dom
Class GeometryImpl

java.lang.Object
  extended by org.jscience.ml.gml.dom.GMLConstructImpl
      extended by org.jscience.ml.gml.dom.GeometryImpl
All Implemented Interfaces:
Geometry, GMLConstruct, GMLConstructOwner, PropertyOwner, UnknownConstructOwner, XMLDescribable
Direct Known Subclasses:
GeometryCollectionImpl

public class GeometryImpl
extends GMLConstructImpl
implements Geometry

A DOM-based implementation of the Geometry interface.


Field Summary
 
Fields inherited from interface org.jscience.ml.gml.infoset.Geometry
GID_ATTR, SRS_NAME_ATTR
 
Constructor Summary
protected GeometryImpl(GeometryOwner owner, org.w3c.dom.Element domElement, GMLDocument document)
          Initializes this geometry and all GML constructs directly owned by it.
 
Method Summary
 CoordinateTupleIterator getCoordinateTupleIterator()
          A convenience method to gain access to geometry coordinates.
 java.lang.String getId()
          Returns the Id of this geometry, presumably specified with gid attribute.
 GeometryIterator getInnerBoundaryIterator()
          A convenience method to gain access to inner boundaries if available.
 PropertyIterator getPropertyIterator()
          Returns an iterator to all properties of this geometry.
 java.lang.String getSRSName()
          Returns the name of the Spatial Reference System (SRS)
 UnknownConstructIterator getUnknownConstructIterator()
          Returns an iterator to all unknown constructs of this geometry.
protected  boolean hasCoordinates()
          DOCUMENT ME!
protected  boolean hasCoords()
          DOCUMENT ME!
protected  boolean hasProperties()
          DOCUMENT ME!
protected  boolean hasUnknownConstructs()
          DOCUMENT ME!
static Geometry newGeometry(GeometryOwner owner, org.w3c.dom.Element domElement, GMLDocument document)
          Creates a new geometry or geometry collection object.
protected  void refreshInternals()
          Refreshes the internal data cache from the DOM source tree.
 java.lang.String toString()
          Returns a one-line string representation of this GML construct.
 
Methods inherited from class org.jscience.ml.gml.dom.GMLConstructImpl
getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeLine, getDOMElement, getGMLConstructIterator, getGMLDocument, getOwner, getXMLDescriptor, hasFeatures, hasGeometries, setGMLDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jscience.ml.gml.infoset.GMLConstruct
getAttribute, getAttribute, getAttribute, getAttributeCount, getOwner
 
Methods inherited from interface org.jscience.ml.gml.infoset.XMLDescribable
getXMLDescriptor
 
Methods inherited from interface org.jscience.ml.gml.infoset.GMLConstructOwner
getGMLConstructIterator
 

Constructor Detail

GeometryImpl

protected GeometryImpl(GeometryOwner owner,
                       org.w3c.dom.Element domElement,
                       GMLDocument document)
Initializes this geometry and all GML constructs directly owned by it. Should be called from newGeometry() method only.

Parameters:
owner - The owner of this geometry.
domElement - The corresponding DOM element.
document - DOCUMENT ME!
See Also:
newGeometry(GeometryOwner,Element,GMLDocument)
Method Detail

getInnerBoundaryIterator

public GeometryIterator getInnerBoundaryIterator()
A convenience method to gain access to inner boundaries if available.

Specified by:
getInnerBoundaryIterator in interface Geometry
Returns:
Iterator to inner boundaries. It is never null.

getCoordinateTupleIterator

public CoordinateTupleIterator getCoordinateTupleIterator()
A convenience method to gain access to geometry coordinates.

Specified by:
getCoordinateTupleIterator in interface Geometry
Returns:
Iterator to coordinate tuples. It is never null.

getId

public java.lang.String getId()
Returns the Id of this geometry, presumably specified with gid attribute.

Specified by:
getId in interface Geometry
Returns:
Null if no Id attribute is specified.

getSRSName

public java.lang.String getSRSName()
Returns the name of the Spatial Reference System (SRS)

Specified by:
getSRSName in interface Geometry
Returns:
Null if the SRS is unspecified.

getUnknownConstructIterator

public UnknownConstructIterator getUnknownConstructIterator()
Returns an iterator to all unknown constructs of this geometry.

Specified by:
getUnknownConstructIterator in interface UnknownConstructOwner
Returns:
DOCUMENT ME!

getPropertyIterator

public PropertyIterator getPropertyIterator()
Returns an iterator to all properties of this geometry.

Specified by:
getPropertyIterator in interface PropertyOwner
Returns:
DOCUMENT ME!

newGeometry

public static Geometry newGeometry(GeometryOwner owner,
                                   org.w3c.dom.Element domElement,
                                   GMLDocument document)
Creates a new geometry or geometry collection object.

Parameters:
owner - DOCUMENT ME!
domElement - DOCUMENT ME!
document - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
Returns a one-line string representation of this GML construct.

Overrides:
toString in class GMLConstructImpl
Returns:
DOCUMENT ME!

hasProperties

protected boolean hasProperties()
DOCUMENT ME!

Overrides:
hasProperties in class GMLConstructImpl
Returns:
DOCUMENT ME!

hasCoords

protected boolean hasCoords()
DOCUMENT ME!

Overrides:
hasCoords in class GMLConstructImpl
Returns:
DOCUMENT ME!

hasCoordinates

protected boolean hasCoordinates()
DOCUMENT ME!

Overrides:
hasCoordinates in class GMLConstructImpl
Returns:
DOCUMENT ME!

hasUnknownConstructs

protected boolean hasUnknownConstructs()
DOCUMENT ME!

Overrides:
hasUnknownConstructs in class GMLConstructImpl
Returns:
DOCUMENT ME!

refreshInternals

protected void refreshInternals()
Refreshes the internal data cache from the DOM source tree. This method should be called each time the underlying DOM structure has changed.

Overrides:
refreshInternals in class GMLConstructImpl