us.zuercher.gpx2map.data
Class WayPoint

java.lang.Object
  extended by us.zuercher.gpx2map.data.AbstractGpxEntity
      extended by us.zuercher.gpx2map.data.WayPoint
Direct Known Subclasses:
RoutePoint, TrackPoint

public class WayPoint
extends AbstractGpxEntity

WayPoint represents a GPX way-point. WayPoints form the basis of both TrackPoint and RoutePoint objects.

WayPoint supports the following properties:

Name Type
name string
cmt string
desc string
src string
sym string
type string
fix string
ele decimal
magvar decimal
geoidheight decimal
hdop decimal
vdop decimal
pdop decimal
ageofdpsdatadecimal
sat integer
dgpsid integer
time date/time

Author:
Stephan Zuercher

Field Summary
protected static Set<String> dateTimePropertyNames
          Way-point string date/time names.
protected static Set<String> decimalPropertyNames
          Way-point decimal property names.
protected static Set<String> integerPropertyNames
          Way-point string integer names.
private  LatLon location
          Way-point coordinate.
protected static Set<String> stringPropertyNames
          Way-point string property names.
 
Fields inherited from class us.zuercher.gpx2map.data.AbstractGpxEntity
dateFormatter
 
Constructor Summary
WayPoint(LatLon location)
          Construct a new WayPoint with the given coordinate.
 
Method Summary
 boolean equals(Object other)
          Tests this WayPoint against another for equality.
 boolean equals(WayPoint other)
          Tests this WayPoint against another for equality.
 Set<String> getDateTimePropertyNames()
          Returns the date/timeproperty names for a WayPoint.
 Set<String> getDecimalPropertyNames()
          Returns the decimal property names for a WayPoint.
 Set<String> getIntegerPropertyNames()
          Returns the integer property names for a WayPoint.
 LatLon getLocation()
          Returns the WayPoint's coordinates.
 Set<String> getStringPropertyNames()
          Returns the string property names for a WayPoint.
 String getType()
          Returns the WayPoints's type.
 int hashCode()
          Computes a reasonable hash code for this WayPoint.
 String toExtendedString()
          Returns a complex representation of this way-point, including all properties.
 String toString()
          Returns a simple string representation of this way-point.
 
Methods inherited from class us.zuercher.gpx2map.data.AbstractGpxEntity
equals, getDateTimeProperty, getDecimalProperty, getIntegerProperty, getStringProperty, setDateTimeProperty, setDecimalProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

stringPropertyNames

protected static final Set<String> stringPropertyNames
Way-point string property names.


decimalPropertyNames

protected static final Set<String> decimalPropertyNames
Way-point decimal property names.


integerPropertyNames

protected static final Set<String> integerPropertyNames
Way-point string integer names.


dateTimePropertyNames

protected static final Set<String> dateTimePropertyNames
Way-point string date/time names.


location

private final LatLon location
Way-point coordinate.

Constructor Detail

WayPoint

public WayPoint(LatLon location)
Construct a new WayPoint with the given coordinate.

Parameters:
location -
Method Detail

getStringPropertyNames

public Set<String> getStringPropertyNames()
Returns the string property names for a WayPoint.

Specified by:
getStringPropertyNames in class AbstractGpxEntity
Returns:
the string property names for a WayPoint.

getDecimalPropertyNames

public Set<String> getDecimalPropertyNames()
Returns the decimal property names for a WayPoint.

Specified by:
getDecimalPropertyNames in class AbstractGpxEntity
Returns:
the decimal property names for a WayPoint.

getIntegerPropertyNames

public Set<String> getIntegerPropertyNames()
Returns the integer property names for a WayPoint.

Specified by:
getIntegerPropertyNames in class AbstractGpxEntity
Returns:
the integer property names for a WayPoint.

getDateTimePropertyNames

public Set<String> getDateTimePropertyNames()
Returns the date/timeproperty names for a WayPoint.

Specified by:
getDateTimePropertyNames in class AbstractGpxEntity
Returns:
the date/time property names for a WayPoint.

getLocation

public LatLon getLocation()
Returns the WayPoint's coordinates.

Returns:
the WayPoint's coordinates.

getType

public String getType()
Returns the WayPoints's type. For a true WayPoint (not a subclass) this is "WPT".

Returns:
the WayPoints type string, "WPT".

toString

public String toString()
Returns a simple string representation of this way-point.

Overrides:
toString in class AbstractGpxEntity
Returns:
a simple string representation of this way-point.

toExtendedString

public String toExtendedString()
Returns a complex representation of this way-point, including all properties.

Returns:
a complex representation of this way-point.

equals

public boolean equals(WayPoint other)
Tests this WayPoint against another for equality. To be equal, the WayPoints must have the same type, location and properties.

Parameters:
other - another WayPoint
Returns:
true if the WayPoints are equal, false otherwise

equals

public boolean equals(Object other)
Tests this WayPoint against another for equality. To be equal, the WayPoints must have the same type, location and properties.

Overrides:
equals in class AbstractGpxEntity
Parameters:
other - another WayPoint
Returns:
true if the WayPoints are equal, false otherwise
Throws:
ClassCastException - if other is not a WayPoint.

hashCode

public int hashCode()
Computes a reasonable hash code for this WayPoint.

Overrides:
hashCode in class AbstractGpxEntity
Returns:
a reasonable hash code for this WayPoint.