org.openstreetmap.josm.data.coor
Class CachedLatLon

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by org.openstreetmap.josm.data.coor.Coordinate
          extended by org.openstreetmap.josm.data.coor.LatLon
              extended by org.openstreetmap.josm.data.coor.CachedLatLon
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

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

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
private  EastNorth eastNorth
           
private  Projection proj
           
 
Fields inherited from class org.openstreetmap.josm.data.coor.LatLon
cDdFormatter, EAST, MAX_SERVER_DIGITS, MAX_SERVER_INV_PRECISION, MAX_SERVER_PRECISION, NORTH, SOUTH, WEST
 
Fields inherited from class org.openstreetmap.josm.data.coor.Coordinate
x, y
 
Constructor Summary
CachedLatLon(double lat, double lon)
           
CachedLatLon(EastNorth eastNorth)
           
CachedLatLon(LatLon coor)
           
 
Method Summary
 EastNorth getEastNorth()
          Replies the projected east/north coordinates.
 Projection getProjection()
           
 void setCoor(LatLon coor)
           
 void setEastNorth(EastNorth eastNorth)
           
 java.lang.String toString()
           
 
Methods inherited from class org.openstreetmap.josm.data.coor.LatLon
dm, dms, equals, equalsEpsilon, getCenter, getRoundedToOsmPrecision, getRoundedToOsmPrecisionStrict, greatCircleDistance, hashCode, heading, interpolate, isOutSideWorld, isValid, isValidLat, isValidLon, isWithin, lat, latToString, lon, lonToString, roundToOsmPrecision, roundToOsmPrecisionStrict, toDisplayString, toIntervalLat, toIntervalLon
 
Methods inherited from class org.openstreetmap.josm.data.coor.Coordinate
getX, getY, setLocation
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

eastNorth

private EastNorth eastNorth

proj

private Projection proj
Constructor Detail

CachedLatLon

public CachedLatLon(double lat,
                    double lon)

CachedLatLon

public CachedLatLon(LatLon coor)

CachedLatLon

public CachedLatLon(EastNorth eastNorth)
Method Detail

setCoor

public final void setCoor(LatLon coor)

setEastNorth

public final void setEastNorth(EastNorth eastNorth)

getEastNorth

public final EastNorth getEastNorth()
Replies the projected east/north coordinates.

Returns:
the internally cached east/north coordinates. null, if the globally defined projection is null

toString

public java.lang.String toString()
Overrides:
toString in class LatLon

getProjection

public Projection getProjection()


JOSM