public class HistoryWay extends HistoryOsmPrimitive
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.Long> |
nodeIds |
MAX_TAG_LENGTH
Constructor and Description |
---|
HistoryWay(long id,
long version,
boolean visible,
User user,
long changesetId,
java.util.Date timestamp)
Constructs a new
HistoryWay . |
HistoryWay(long id,
long version,
boolean visible,
User user,
long changesetId,
java.util.Date timestamp,
boolean checkHistoricParams)
Constructs a new
HistoryWay with a configurable checking of historic parameters. |
HistoryWay(long id,
long version,
boolean visible,
User user,
long changesetId,
java.util.Date timestamp,
java.util.List<java.lang.Long> nodeIdList)
Constructs a new
HistoryWay with a given list of node ids. |
HistoryWay(Way w)
Constructs a new
HistoryWay from an existing Way . |
Modifier and Type | Method and Description |
---|---|
void |
addNode(long ref)
adds a node id to the list nodes of this way
|
WayData |
fillPrimitiveData(WayData data)
Fills the way attributes with values from this history.
|
java.lang.String |
getDisplayName(HistoryNameFormatter formatter)
Replies the display name of a primitive formatted by
formatter |
long |
getNodeId(int idx)
replies the idx-th node id in the list of node ids of this way
|
java.util.List<java.lang.Long> |
getNodes()
replies an immutable list of the ways node ids
|
int |
getNumNodes()
replies the number of nodes in this way
|
OsmPrimitiveType |
getType()
replies the ways type, i.e.
|
boolean |
isClosed()
Replies true if this way is closed.
|
compareTo, ensurePositiveLong, equals, fillPrimitiveCommonData, forOsmPrimitive, get, getChangeset, getChangesetId, getId, getKeys, getLocalName, getName, getNumKeys, getPrimitiveId, getTags, getTimestamp, getUser, getVersion, hashCode, hasKey, hasKeys, isVisible, keySet, matches, matches, put, remove, removeAll, setChangeset, setKeys, setTags, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasTag, hasTag, hasTag, hasTag, hasTagDifferent, hasTagDifferent, hasTagDifferent, put, visitKeys
private final java.util.List<java.lang.Long> nodeIds
public HistoryWay(long id, long version, boolean visible, User user, long changesetId, java.util.Date timestamp)
HistoryWay
.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 if checkHistoricParams
is true)timestamp
- the timestamp (!= null required if checkHistoricParams
is true)java.lang.IllegalArgumentException
- if preconditions are violatedpublic HistoryWay(long id, long version, boolean visible, User user, long changesetId, java.util.Date timestamp, boolean checkHistoricParams)
HistoryWay
with a configurable checking of historic parameters.
This is needed to build virtual HistoryWays for modified ways, which do not have a timestamp and a changeset id.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 if checkHistoricParams
is true)timestamp
- the timestamp (!= null required if checkHistoricParams
is true)checkHistoricParams
- if true, checks values of changesetId
and timestamp
java.lang.IllegalArgumentException
- if preconditions are violatedpublic HistoryWay(long id, long version, boolean visible, User user, long changesetId, java.util.Date timestamp, java.util.List<java.lang.Long> nodeIdList)
HistoryWay
with a given list of node ids.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 if checkHistoricParams
is true)timestamp
- the timestamp (!= null required if checkHistoricParams
is true)nodeIdList
- the node ids (!= null required)java.lang.IllegalArgumentException
- if preconditions are violatedpublic HistoryWay(Way w)
HistoryWay
from an existing Way
.w
- the waypublic int getNumNodes()
public long getNodeId(int idx)
idx
- the indexjava.lang.IndexOutOfBoundsException
- if idx < 0 || idx >= {#see getNumNodes()
public java.util.List<java.lang.Long> getNodes()
public OsmPrimitiveType getType()
OsmPrimitiveType.WAY
getType
in class HistoryOsmPrimitive
public void addNode(long ref)
ref
- the node id to addpublic boolean isClosed()
public java.lang.String getDisplayName(HistoryNameFormatter formatter)
HistoryOsmPrimitive
formatter
getDisplayName
in class HistoryOsmPrimitive
formatter
- The formatter used to generate a display namepublic WayData fillPrimitiveData(WayData data)
data
- way data to fill