Package org.ka2ddo.yaac.osm
Class GTNWrapper
java.lang.Object
org.ka2ddo.yaac.osm.GTNWrapper
- All Implemented Interfaces:
Comparable<GTNWrapper>
This class wraps a OpenStreetMap record (way or node) found by the
OsmSearcher
to conveniently provide its position and distance from the map center so the GUI can
sort it in with other search results.- Author:
- Andrew Pavlin, KA2DDO
-
Field Summary
Modifier and TypeFieldDescriptionfinal float
Direction from map center to this Way or Node.final GenericTaggedNode<?>
The Way or Node that was found by the OsmSearcher,final int
Latitude of this Node, or nearest latitude of this Way.final int
Longitude of this Node, or nearest longitude of this Way.final int
Distance in meters from the map center to this Way or Node.static final Comparator<GTNWrapper>
Comparator for sorting wrapped GTNWrapper objects by their radial distance away from the search center point. -
Constructor Summary
ConstructorDescriptionGTNWrapper
(GenericTaggedNode<?> gtn, double radiusM, float bearing, int lat, int lon) Constructor for a GTNWrapper. -
Method Summary
-
Field Details
-
gtn
The Way or Node that was found by the OsmSearcher, -
radiusM
public final int radiusMDistance in meters from the map center to this Way or Node. -
bearing
public final float bearingDirection from map center to this Way or Node. -
nearestLat
public final int nearestLatLatitude of this Node, or nearest latitude of this Way. -
nearestLon
public final int nearestLonLongitude of this Node, or nearest longitude of this Way. -
SORT_BY_RADIUS
Comparator for sorting wrapped GTNWrapper objects by their radial distance away from the search center point.
-
-
Constructor Details
-
GTNWrapper
Constructor for a GTNWrapper.- Parameters:
gtn
- The Way or Node that was found by the OsmSearcher,radiusM
- Distance in meters from the map center to this Way or Node.bearing
- bearing in degrees from True North from map center to this Way or Node.lat
- Latitude of this Node, or nearest latitude of this Way.lon
- Longitude of this Node, or nearest longitude of this Way.
-
-
Method Details
-
toString
Returns a string representation of the object. -
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided byjava.util.Hashtable
. -
compareTo
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareTo
in interfaceComparable<GTNWrapper>
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
NullPointerException
- if the specified object is nullClassCastException
- if the specified object's type prevents it from being compared to this object.
-