org.openstreetmap.josm.data.osm.history
Class HistoryNode

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive
      extended by org.openstreetmap.josm.data.osm.history.HistoryNode
All Implemented Interfaces:
java.lang.Comparable<HistoryOsmPrimitive>

public class HistoryNode
extends HistoryOsmPrimitive

Represents an immutable OSM node in the context of a historical view on OSM data.


Field Summary
private  LatLon coords
          the coordinates.
 
Constructor Summary
HistoryNode(long id, long version, boolean visible, User user, long changesetId, java.util.Date timestamp, LatLon coords)
          Constructs a new HistoryNode.
HistoryNode(long id, long version, boolean visible, User user, long changesetId, java.util.Date timestamp, LatLon coords, boolean checkHistoricParams)
          Constructs a new HistoryNode with a configurable checking of historic parameters.
HistoryNode(Node n)
          Constructs a new HistoryNode from an existing Node.
 
Method Summary
 LatLon getCoords()
          Replies the coordinates.
 java.lang.String getDisplayName(HistoryNameFormatter formatter)
          Replies the display name of a primitive formatted by formatter
 OsmPrimitiveType getType()
           
 void setCoords(LatLon coords)
          Sets the coordinates.
 
Methods inherited from class org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive
compareTo, ensurePositiveLong, equals, forOsmPrimitive, get, getChangesetId, getId, getLocalName, getName, getPrimitiveId, getTags, getTimestamp, getUser, getVersion, hashCode, hasTag, isVisible, matches, matches, put, setTags, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

coords

private LatLon coords
the coordinates. May be null for deleted nodes

Constructor Detail

HistoryNode

public HistoryNode(long id,
                   long version,
                   boolean visible,
                   User user,
                   long changesetId,
                   java.util.Date timestamp,
                   LatLon coords)
            throws java.lang.IllegalArgumentException
Constructs a new HistoryNode.

Parameters:
id - the id (> 0 required)
version - the version (> 0 required)
visible - whether the node is still visible
user - the user (! null required)
changesetId - the changeset id (> 0 required)
timestamp - the timestamp (! null required)
coords - the coordinates
Throws:
java.lang.IllegalArgumentException - if preconditions are violated

HistoryNode

public HistoryNode(long id,
                   long version,
                   boolean visible,
                   User user,
                   long changesetId,
                   java.util.Date timestamp,
                   LatLon coords,
                   boolean checkHistoricParams)
            throws java.lang.IllegalArgumentException
Constructs a new HistoryNode with a configurable checking of historic parameters. This is needed to build virtual HistoryNodes for modified nodes, which do not have a timestamp and a changeset id.

Parameters:
id - the id (> 0 required)
version - the version (> 0 required)
visible - whether the node is still visible
user - the user (! null required)
changesetId - the changeset id (> 0 required if checkHistoricParams is true)
timestamp - the timestamp (! null required if checkHistoricParams is true)
coords - the coordinates
checkHistoricParams - if true, checks values of changesetId and timestamp
Throws:
java.lang.IllegalArgumentException - if preconditions are violated
Since:
5440

HistoryNode

public HistoryNode(Node n)
Constructs a new HistoryNode from an existing Node.

Parameters:
n - the node
Method Detail

getType

public OsmPrimitiveType getType()
Specified by:
getType in class HistoryOsmPrimitive

getCoords

public LatLon getCoords()
Replies the coordinates. May be null.

Returns:
the coordinates. May be null.

setCoords

public void setCoords(LatLon coords)
Sets the coordinates. Can be null.

Parameters:
coords - the coordinates. Can be null.

getDisplayName

public java.lang.String getDisplayName(HistoryNameFormatter formatter)
Description copied from class: HistoryOsmPrimitive
Replies the display name of a primitive formatted by formatter

Specified by:
getDisplayName in class HistoryOsmPrimitive
Parameters:
formatter - The formatter used to generate a display name
Returns:
the display name


JOSM