public class WayPoint extends WithAttributes implements java.lang.Comparable<WayPoint>, TemplateEngineDataProvider, ILatLon
Modifier and Type | Field and Description |
---|---|
java.awt.Color |
customColoring
The color to draw the segment before this point in
|
int |
dir
The direction of the line before this point.
|
boolean |
drawLine
true indicates that the line before this point should be drawn |
private double |
east |
private java.lang.Object |
eastNorthCacheKey |
private double |
lat |
private double |
lon |
private double |
north |
double |
time
The seconds (not milliseconds!) since 1970-01-01 00:00 UTC
|
attr
FIX_VALUES, GPX_CMT, GPX_DESC, GPX_NAME, GPX_SRC, JOSM_EXTENSIONS_NAMESPACE_URI, META_AUTHOR_EMAIL, META_AUTHOR_LINK, META_AUTHOR_NAME, META_BOUNDS, META_COPYRIGHT_AUTHOR, META_COPYRIGHT_LICENSE, META_COPYRIGHT_YEAR, META_DESC, META_EXTENSIONS, META_KEYWORDS, META_LINKS, META_NAME, META_PREFIX, META_TIME, PT_AGEOFDGPSDATA, PT_DGPSID, PT_ELE, PT_FIX, PT_GEOIDHEIGHT, PT_HDOP, PT_MAGVAR, PT_PDOP, PT_SAT, PT_SYM, PT_TIME, PT_TYPE, PT_VDOP, RTE_TRK_KEYS, WPT_KEYS
Constructor and Description |
---|
WayPoint(LatLon ll)
Constructs a new
WayPoint from lat/lon coordinates. |
WayPoint(WayPoint p)
Constructs a new
WayPoint from an existing one. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(WayPoint w) |
boolean |
equals(java.lang.Object obj) |
boolean |
evaluateCondition(SearchCompiler.Match condition)
Check if a condition holds for the object represented by this
TemplateEngineDataProvider . |
LatLon |
getCoor()
Returns the waypoint coordinates.
|
EastNorth |
getEastNorth(Projecting projecting)
Replies the projected east/north coordinates.
|
java.util.List<java.lang.String> |
getTemplateKeys()
Get the collection of all keys that can be mapped to values.
|
java.lang.Object |
getTemplateValue(java.lang.String name,
boolean special)
Map a key to a value given the properties of the object.
|
java.util.Date |
getTime()
Returns the waypoint time.
|
int |
hashCode() |
void |
invalidateEastNorthCache()
Invalidate the internal cache of east/north coordinates.
|
double |
lat()
Returns the latitude, i.e., the north-south position in degrees.
|
double |
lon()
Returns the longitude, i.e., the east-west position in degrees.
|
void |
setTime()
Convert the time stamp of the waypoint into seconds from the epoch
|
void |
setTime(java.util.Date time)
Sets the
time field as well as the GpxConstants.PT_TIME attribute to the specified time |
void |
setTime(long time)
Set the the time stamp of the waypoint into seconds from the epoch,
|
java.util.Date |
setTimeFromAttribute()
Convert the time stamp of the waypoint into seconds from the epoch
|
java.lang.String |
toString() |
addExtension, get, getCollection, getString, put
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isLatLonKnown
public double time
public java.awt.Color customColoring
drawLine
public boolean drawLine
true
indicates that the line before this point should be drawnpublic int dir
private final double lat
private final double lon
private double east
private double north
private java.lang.Object eastNorthCacheKey
public WayPoint(WayPoint p)
WayPoint
from an existing one.p
- existing waypointpublic void invalidateEastNorthCache()
public final LatLon getCoor()
public double lon()
ILatLon
lon
in interface ILatLon
ILatLon.isLatLonKnown()
returns falsepublic double lat()
ILatLon
lat
in interface ILatLon
ILatLon.isLatLonKnown()
returns falsepublic final EastNorth getEastNorth(Projecting projecting)
ILatLon
The result of the last conversion may be cached. Null is returned in case this object is invalid.
getEastNorth
in interface ILatLon
projecting
- The projection to use.public java.lang.String toString()
toString
in class java.lang.Object
public void setTime(java.util.Date time)
time
field as well as the GpxConstants.PT_TIME
attribute to the specified timetime
- the time to setpublic void setTime()
public void setTime(long time)
time
- millisecond from the epochpublic java.util.Date setTimeFromAttribute()
null
public int compareTo(WayPoint w)
compareTo
in interface java.lang.Comparable<WayPoint>
public java.util.Date getTime()
public java.lang.Object getTemplateValue(java.lang.String name, boolean special)
TemplateEngineDataProvider
getTemplateValue
in interface TemplateEngineDataProvider
name
- the key to mapspecial
- if the key is a "special:*" keyword that is used
to get certain information or automated behaviorspecial
is truepublic boolean evaluateCondition(SearchCompiler.Match condition)
TemplateEngineDataProvider
TemplateEngineDataProvider
.evaluateCondition
in interface TemplateEngineDataProvider
condition
- the condition to check (which is a search expression)public java.util.List<java.lang.String> getTemplateKeys()
TemplateEngineDataProvider
getTemplateKeys
in interface TemplateEngineDataProvider
public int hashCode()
hashCode
in class WithAttributes
public boolean equals(java.lang.Object obj)
equals
in class WithAttributes