org.jscience.ml.gml.dom
Class CoordImpl

java.lang.Object
  extended by org.jscience.ml.gml.dom.GMLConstructImpl
      extended by org.jscience.ml.gml.dom.CoordImpl
All Implemented Interfaces:
Coord, CoordinateTuple, GMLConstruct, GMLConstructOwner, PropertyOwner, UnknownConstructOwner, XMLDescribable

public class CoordImpl
extends GMLConstructImpl
implements Coord

A DOM-based implementation of the Coord interface.


Field Summary
 
Fields inherited from interface org.jscience.ml.gml.infoset.Coord
X_PROP, Y_PROP, Z_PROP
 
Fields inherited from interface org.jscience.ml.gml.infoset.CoordinateTuple
X_INDEX, Y_INDEX, Z_INDEX
 
Constructor Summary
CoordImpl(Geometry owner, org.w3c.dom.Element domElement, GMLDocument document)
          Initializes this coord construct and all GML constructs directly owned by it.
 
Method Summary
 Coordinate getCoordinate(int index)
          Returns the n-th coordinate of this coordinate tuple.
 PropertyIterator getPropertyIterator()
          Returns an iterator to all properties of this feature.
 UnknownConstructIterator getUnknownConstructIterator()
          Returns an iterator to all unknown constructs of this feature.
 Coordinate getX()
          Convenience method to retrieve the first coordinate.
 Coordinate getY()
          Convenience method to retrieve the second coordinate.
 Coordinate getZ()
          Convenience method to retrieve the third coordinate.
protected  boolean hasProperties()
          DOCUMENT ME!
protected  boolean hasUnknownConstructs()
          DOCUMENT ME!
protected  void refreshInternals()
          Refreshes the internal cache of owned GML constructs.
 java.lang.String toString()
          Returns a one-line description of this coord.
 
Methods inherited from class org.jscience.ml.gml.dom.GMLConstructImpl
getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeLine, getDOMElement, getGMLConstructIterator, getGMLDocument, getOwner, getXMLDescriptor, hasCoordinates, hasCoords, 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

CoordImpl

public CoordImpl(Geometry owner,
                 org.w3c.dom.Element domElement,
                 GMLDocument document)
Initializes this coord construct and all GML constructs directly owned by it.

Parameters:
owner - The owner of this coord.
domElement - The corresponding DOM element.
document - DOCUMENT ME!
Method Detail

getUnknownConstructIterator

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

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

getPropertyIterator

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

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

getX

public Coordinate getX()
Convenience method to retrieve the first coordinate.

Specified by:
getX in interface CoordinateTuple
Returns:
Cannot be null.

getY

public Coordinate getY()
Convenience method to retrieve the second coordinate.

Specified by:
getY in interface CoordinateTuple
Returns:
Can be null if Y-coordinate is not present.

getZ

public Coordinate getZ()
Convenience method to retrieve the third coordinate.

Specified by:
getZ in interface CoordinateTuple
Returns:
Can be null if Z-coordinate is not present.

getCoordinate

public Coordinate getCoordinate(int index)
Returns the n-th coordinate of this coordinate tuple.

Specified by:
getCoordinate in interface CoordinateTuple
Parameters:
index - Represents an index into the coordinate tuple. The lowest index is 0.
Returns:
Returns null if the index is out of range.

toString

public java.lang.String toString()
Returns a one-line description of this coord.

Overrides:
toString in class GMLConstructImpl
Returns:
DOCUMENT ME!

hasUnknownConstructs

protected boolean hasUnknownConstructs()
DOCUMENT ME!

Overrides:
hasUnknownConstructs in class GMLConstructImpl
Returns:
DOCUMENT ME!

hasProperties

protected boolean hasProperties()
DOCUMENT ME!

Overrides:
hasProperties in class GMLConstructImpl
Returns:
DOCUMENT ME!

refreshInternals

protected void refreshInternals()
Refreshes the internal cache of owned GML constructs. This method is called also upon the construction of the object.

Overrides:
refreshInternals in class GMLConstructImpl