Package org.openstreetmap.josm.data.coor
Class CachedLatLon
- java.lang.Object
-
- org.openstreetmap.josm.data.coor.Coordinate
-
- org.openstreetmap.josm.data.coor.LatLon
-
- org.openstreetmap.josm.data.coor.CachedLatLon
-
- All Implemented Interfaces:
java.io.Serializable,ILatLon
public class CachedLatLon extends LatLon
LatLon class that maintains a cache of projected EastNorth coordinates. This class is convenient to use, but has relatively high memory costs. It keeps a pointer to the last known projection in order to detect projection changes. Node and WayPoint have another, optimized, cache for projected coordinates.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ObjectcacheKeyprivate EastNortheastNorthprivate static longserialVersionUID-
Fields inherited from class org.openstreetmap.josm.data.coor.LatLon
cDdFormatter, cDdHighPrecisionFormatter, MAX_SERVER_INV_PRECISION, MAX_SERVER_PRECISION, NORTH_POLE, SOUTH_POLE, ZERO
-
Fields inherited from class org.openstreetmap.josm.data.coor.Coordinate
x, y
-
-
Constructor Summary
Constructors Modifier Constructor Description CachedLatLon(double lat, double lon)Constructs a newCachedLatLon.CachedLatLon(EastNorth eastNorth)Constructs a newCachedLatLon.privateCachedLatLon(EastNorth eastNorth, Projection projection)CachedLatLon(LatLon coor)Constructs a newCachedLatLon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)EastNorthgetEastNorth(Projecting projecting)Replies the projected east/north coordinates.inthashCode()java.lang.StringtoString()-
Methods inherited from class org.openstreetmap.josm.data.coor.LatLon
distance, distanceSq, getCenter, getRoundedToOsmPrecision, interpolate, isIn, isValid, isValidLat, isValidLon, isWithin, lat, lon, normalizeLon, roundToOsmPrecision, toDisplayString, toIntervalLat, toIntervalLon
-
Methods inherited from class org.openstreetmap.josm.data.coor.Coordinate
distance, distance, distanceSq, distanceSq, getX, getY
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, greatCircleDistance, interpolate, isLatLonKnown
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
cacheKey
private transient java.lang.Object cacheKey
-
-
Constructor Detail
-
CachedLatLon
public CachedLatLon(double lat, double lon)
Constructs a newCachedLatLon.- Parameters:
lat- latitudelon- longitude
-
CachedLatLon
public CachedLatLon(LatLon coor)
Constructs a newCachedLatLon.- Parameters:
coor- lat/lon
-
CachedLatLon
public CachedLatLon(EastNorth eastNorth)
Constructs a newCachedLatLon.- Parameters:
eastNorth- easting/northing
-
CachedLatLon
private CachedLatLon(EastNorth eastNorth, Projection projection)
-
-
Method Detail
-
getEastNorth
public final EastNorth getEastNorth(Projecting projecting)
Replies the projected east/north coordinates.- Parameters:
projecting- The projection to use.- Returns:
- the internally cached east/north coordinates. null, if the globally defined projection is null
-
-