Class HistoryNode
java.lang.Object
org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive
org.openstreetmap.josm.data.osm.history.HistoryNode
- All Implemented Interfaces:
Comparable<HistoryOsmPrimitive>,PrimitiveId,Tagged
Represents an immutable OSM node in the context of a historical view on OSM data.
- Since:
- 1670
-
Field Summary
FieldsFields inherited from interface org.openstreetmap.josm.data.osm.Tagged
MAX_TAG_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionHistoryNode(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, LatLon coords) Constructs a newHistoryNode.HistoryNode(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, LatLon coords, boolean checkHistoricParams) Constructs a newHistoryNodewith a configurable checking of historic parameters.HistoryNode(Node n) Constructs a newHistoryNodefrom an existingNode. -
Method Summary
Modifier and TypeMethodDescriptionfillPrimitiveData(NodeData data) Fills the node attributes with values from this history.final LatLonReplies the coordinates.getDisplayName(HistoryNameFormatter formatter) Replies the display name of a primitive formatted byformattergetType()Gets the type of object represented by this object.final voidSets the coordinates.Methods inherited from class org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive
compareTo, ensurePositiveLong, equals, fillPrimitiveCommonData, forOsmPrimitive, get, getChangeset, getChangesetId, getId, getInstant, getKeys, getLocalName, getName, getNumKeys, getPrimitiveId, getTags, getUniqueId, getUser, getVersion, hashCode, hasKey, hasKeys, isNew, isVisible, keySet, matches, matches, put, remove, removeAll, setChangeset, setKeys, setTags, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.osm.Tagged
hasTag, hasTag, hasTag, hasTag, hasTagDifferent, hasTagDifferent, hasTagDifferent, isKeyFalse, isKeyTrue, keys, put, putAll, visitKeys
-
Field Details
-
coords
the coordinates. May be null for deleted nodes
-
-
Constructor Details
-
HistoryNode
public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, LatLon coords) Constructs a newHistoryNode.- Parameters:
id- the id (> 0 required)version- the version (> 0 required)visible- whether the node is still visibleuser- the user (!= null required)changesetId- the changeset id (> 0 required)timestamp- the timestamp (!= null required)coords- the coordinates- Throws:
IllegalArgumentException- if preconditions are violated
-
HistoryNode
public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, LatLon coords, boolean checkHistoricParams) Constructs a newHistoryNodewith 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 visibleuser- the user (!= null required)changesetId- the changeset id (> 0 required ifcheckHistoricParamsis true)timestamp- the timestamp (!= null required ifcheckHistoricParamsis true)coords- the coordinatescheckHistoricParams- if true, checks values ofchangesetIdandtimestamp- Throws:
IllegalArgumentException- if preconditions are violated- Since:
- 5440
-
HistoryNode
Constructs a newHistoryNodefrom an existingNode.- Parameters:
n- the node
-
-
Method Details
-
getType
Description copied from interface:PrimitiveIdGets the type of object represented by this object. Note that this should return the base primitive type (OsmPrimitiveType.NODE,OsmPrimitiveType.WAY, andOsmPrimitiveType.RELATION). -
getCoords
Replies the coordinates. May be null.- Returns:
- the coordinates. May be null.
-
setCoords
Sets the coordinates. Can be null.- Parameters:
coords- the coordinates. Can be null.
-
getDisplayName
Description copied from class:HistoryOsmPrimitiveReplies the display name of a primitive formatted byformatter- Specified by:
getDisplayNamein classHistoryOsmPrimitive- Parameters:
formatter- The formatter used to generate a display name- Returns:
- the display name
-
fillPrimitiveData
Fills the node attributes with values from this history.- Parameters:
data- node data to fill- Returns:
- filled node data
- Since:
- 11878
-