ecologylab.xml.library.kml.geometry
Class Coordinates
java.lang.Object
ecologylab.generic.Debug
ecologylab.xml.ElementState
ecologylab.xml.library.kml.geometry.Coordinates
- All Implemented Interfaces:
- OptimizationTypes, XMLTranslationExceptionTypes
public class Coordinates
- extends ElementState
The Coordinates object is a special case specifically for KML. Because KML
nests a list of coordinates as comma-delimited values within an XML element,
we need this special, hybrid object.
The Coordinates object stores TWO representations of its data: one in the
String, comma-delimited form (field:coords) for going to/from KML and the
other in the form of an ArrayList for use by programmers
(field:coordinateList).
When a Coordinates object is translated FROM KML, the coordinateList is
automatically filled in using the the coords String. When it is translated TO
KML, the values in the coordinateList are serialized to the coords String.
- Author:
- Zach
| Fields inherited from interface ecologylab.xml.OptimizationTypes |
BAD_FIELD, COLLECTION_ELEMENT, COLLECTION_SCALAR, IGNORED_ATTRIBUTE, IGNORED_ELEMENT, LEAF_NODE_VALUE, MAP_ELEMENT, MAP_SCALAR, NAME_SPACE_ATTRIBUTE, NAME_SPACE_LEAF_NODE, NAME_SPACE_MASK, NAME_SPACE_NESTED_ELEMENT, NAMESPACE_IGNORED_ELEMENT, NAMESPACE_TRIAL_ELEMENT, OTHER_NESTED_ELEMENT, REGULAR_ATTRIBUTE, REGULAR_NESTED_ELEMENT, ROOT, UNSET_TYPE, XMLNS_ATTRIBUTE, XMLNS_IGNORED |
|
Constructor Summary |
Coordinates()
|
Coordinates(java.lang.String coords)
Initialize with a string of coordinates, which should be comma-delimited
triples (latitude, longitude, altitude). |
| Methods inherited from class ecologylab.xml.ElementState |
addNestedElement, addNestedElement, appendTextNodeString, buildDOM, buildDOM, buildDOM, buildDOM, buildDOM, buildDOMFromXMLCharSequence, buildDOMFromXMLString, checkAnnotation, convertNameStyles, createChildHook, fieldToXMLOptimizations, floatingPrecision, getCollection, getElementStateById, getMap, getNestedNameSpace, getTextNodeString, leafElementFieldNames, lookupNestedNameSpace, optimizations, parent, recycle, setDeclarationStyle, setFieldUsingTypeRegistry, setFloatingPrecision, setParent, setUseDOMForTranslateTo, translateFromXML, translateFromXML, translateFromXML, translateFromXML, translateFromXML, translateFromXMLCharSequence, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOMCharSequence, translateFromXMLDOMCharSequence, translateFromXMLRootNode, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateToDOM, translateToXML, translateToXML, translateToXML, translateToXML, writePrettyXML, writePrettyXML, writePrettyXML |
| Methods inherited from class ecologylab.generic.Debug |
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Coordinates
public Coordinates()
Coordinates
public Coordinates(java.lang.String coords)
- Initialize with a string of coordinates, which should be comma-delimited
triples (latitude, longitude, altitude).
- Parameters:
coords -
appendStringRepresentation
protected void appendStringRepresentation(java.lang.String coords)
- Parses a String of coordinates, expressed as comma-delimited triples
(longitude, latitude, altitude). If the last triple in the list is
incomplete, it is not appended unless it is a special case of having
exactly two, in which case the altitude is assumed to be 0.
- Parameters:
coords -
getCoordinateList
public java.util.ArrayList<GeoCoordinate> getCoordinateList()
getCoords
public java.lang.String getCoords()
postTranslationProcessingHook
protected void postTranslationProcessingHook()
- Parses and adds the geographic coordinates in coords to the
coordinateList; called automatically immediately after translating FROM
KML.
- Overrides:
postTranslationProcessingHook in class ElementState
preTranslationProcessingHook
protected void preTranslationProcessingHook()
- Loads coords with the current values from coordinateList; called
automatically immediately before translating this TO KML.
- Overrides:
preTranslationProcessingHook in class ElementState
setCoords
public void setCoords(java.lang.String coords)
toString
public java.lang.String toString()
- Overrides:
toString in class Debug