public final class Node extends OsmPrimitive implements INode
| Modifier and Type | Field and Description |
|---|---|
private double |
east |
private double |
lat |
private double |
lon |
private double |
north |
allPredicate, FLAG_ANNOTATED, FLAG_DIRECTION_REVERSED, FLAG_DISABLED, FLAG_DISABLED_TYPE, FLAG_HAS_DIRECTIONS, FLAG_HIDDEN_TYPE, FLAG_HIDE_IF_DISABLED, FLAG_HIGHLIGHTED, FLAG_TAGGED, isSelectablePredicate, isUsablePredicate, mappaintCacheIdx, mappaintStyle, modifiedPredicate, multipolygonPredicate, nodePredicate, nonDeletedCompletePredicate, nonDeletedPhysicalPredicate, nonDeletedPredicate, relationPredicate, wayPredicatechangesetId, FLAG_DELETED, FLAG_INCOMPLETE, FLAG_MODIFIED, FLAG_VISIBLE, flags, id, keys, timestamp, user, version| Modifier | Constructor and Description |
|---|---|
|
Node()
Constructs a new local
Node with id 0. |
|
Node(EastNorth eastNorth)
Constructs a new
Node with the given east/north with id 0. |
|
Node(LatLon latlon)
Constructs a new
Node with the given lat/lon with id 0. |
|
Node(long id)
Constructs an incomplete
Node object with the given id. |
protected |
Node(long id,
boolean allowNegative) |
|
Node(long id,
int version)
Constructs a new
Node with the given id and version. |
|
Node(Node clone)
Constructs an identical clone of the argument (including the id).
|
|
Node(Node clone,
boolean clearMetadata)
Constructs an identical clone of the argument.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PrimitiveVisitor visitor) |
void |
accept(Visitor visitor)
Implementation of the visitor scheme.
|
void |
cloneFrom(OsmPrimitive osm)
Get and write all attributes from the parameter.
|
int |
compareTo(OsmPrimitive o) |
boolean |
concernsArea()
Determines if this primitive semantically concerns an area.
|
BBox |
getBBox()
Fetch the bounding box of the primitive
|
LatLon |
getCoor() |
java.lang.String |
getDisplayName(NameFormatter formatter)
Replies the display name of a primitive formatted by
formatter |
EastNorth |
getEastNorth()
Replies the projected east/north coordinates.
|
OsmPrimitiveType |
getType()
Gets the type of object represented by this object.
|
boolean |
hasEqualSemanticAttributes(OsmPrimitive other)
Replies true if this primitive and other are equal with respect to their
semantic attributes.
|
void |
invalidateEastNorthCache()
Invoke to invalidate the internal cache of projected east/north coordinates.
|
boolean |
isConnectedTo(java.util.Collection<Node> otherNodes,
int hops,
Predicate<Node> predicate)
Tests whether
this node is connected to otherNode via at most hops nodes
matching the predicate (which may be null to consider all nodes). |
private boolean |
isConnectedTo(java.util.Collection<Node> otherNodes,
int hops,
Predicate<Node> predicate,
java.util.Set<Node> visited) |
boolean |
isConnectionNode()
Check whether this node connects 2 ways.
|
boolean |
isDrawable() |
boolean |
isLatLonKnown()
Determines if this node has valid coordinates.
|
boolean |
isOutsideDownloadArea()
Tests if this primitive lies outside of the downloaded area of its
DataSet. |
void |
load(PrimitiveData data)
Loads (clone) this primitive from provided PrimitiveData
|
void |
mergeFrom(OsmPrimitive other)
Merges the technical and semantical attributes from
other onto this. |
NodeData |
save()
Save parameters of this primitive to the transport object
|
void |
setCoor(LatLon coor) |
protected void |
setCoorInternal(LatLon coor,
EastNorth eastNorth)
To be used only by Dataset.reindexNode
|
(package private) void |
setDataset(DataSet dataSet)
This method should never ever by called from somewhere else than Dataset.addPrimitive or removePrimitive methods
|
void |
setEastNorth(EastNorth eastNorth) |
java.lang.String |
toString() |
private void |
updateCoor(LatLon coor,
EastNorth eastNorth) |
void |
updatePosition()
Called by Dataset to update cached position information of primitive (bbox, cached EarthNorth, ...)
|
addReferrer, checkDataset, clearCachedStyle, clearOsmMetadata, equals, evaluateCondition, getDataSet, getDisabledType, getDiscardableKeys, getFilteredList, getFilteredSet, getFlagsAsString, getHiddenType, getInterestingTags, getParentRelations, getReferrer, getReferrers, getReferrers, getTemplateKeys, getTemplateValue, getUninterestingKeys, getWorkInProgressKeys, hasAreaTags, hasDirectionKeys, hasEqualTechnicalAttributes, hashCode, hasSameInterestingTags, isAnnotated, isDisabled, isDisabledAndHidden, isHighlighted, isMemberOfSelected, isOuterMemberOfSelected, isReferredByWays, isSelectable, isSelected, isTagged, isUninterestingKey, keysChangedImpl, put, remove, removeAll, removeReferrer, reversedDirection, saveCommonAttributes, setChangesetId, setDeleted, setDisabledState, setDisabledType, setHiddenType, setHighlighted, setIncomplete, setKeys, setOsmId, setTimestamp, setUser, setVisible, unsetDisabledState, updateFlags, visitReferrers, writeLock, writeUnlockcloneFrom, generateUniqueId, get, getChangesetId, getDisplayType, getId, getIgnoreCase, getKeys, getLocalName, getName, getNumKeys, getPrimitiveId, getTimestamp, getUniqueId, getUser, getVersion, hasKey, hasKeys, hasTag, hasTag, hasTag, isDeleted, isIncomplete, isKeyFalse, isKeyTrue, isModified, isNew, isNewOrUndeleted, isTimestampEmpty, isUndeleted, isUsable, isVisible, keySet, setModifiedclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChangesetId, getId, getLocalName, getName, getPrimitiveId, getTimestamp, getUser, getVersion, isDeleted, isIncomplete, isModified, isNewOrUndeleted, isTimestampEmpty, isVisible, setChangesetId, setDeleted, setModified, setOsmId, setTimestamp, setUser, setVisibleget, getKeys, hasKeys, keySet, put, remove, removeAll, setKeysgetUniqueId, isNewprivate double lat
private double lon
private double east
private double north
protected Node(long id, boolean allowNegative)
public Node()
Node with id 0.public Node(long id) throws java.lang.IllegalArgumentException
Node object with the given id.id - The id. Must be >= 0java.lang.IllegalArgumentException - if id < 0public Node(long id, int version) throws java.lang.IllegalArgumentException
Node with the given id and version.id - The id. Must be >= 0version - The versionjava.lang.IllegalArgumentException - if id < 0public Node(Node clone, boolean clearMetadata)
clone - The node to cloneclearMetadata - If true, clears the OSM id and other metadata as defined by OsmPrimitive.clearOsmMetadata(). If false, does nothingpublic Node(Node clone)
clone - The node to clone, including its idpublic Node(LatLon latlon)
Node with the given lat/lon with id 0.latlon - The LatLon coordinatespublic final boolean isLatLonKnown()
true if this node has valid coordinatespublic final void setEastNorth(EastNorth eastNorth)
setEastNorth in interface INodeprivate void updateCoor(LatLon coor, EastNorth eastNorth)
public final EastNorth getEastNorth()
Replies the projected east/north coordinates.
Uses the global projection to project the lan/lon-coordinates.
Internally caches the projected coordinates.
Caveat: doesn't listen to projection changes. Clients must
invalidate the internal cache.
Replies null if this node doesn't know lat/lon-coordinates, i.e. because it is an incomplete node.
getEastNorth in interface INodenullinvalidateEastNorthCache()protected void setCoorInternal(LatLon coor, EastNorth eastNorth)
void setDataset(DataSet dataSet)
OsmPrimitivesetDataset in class OsmPrimitivepublic void accept(Visitor visitor)
OsmPrimitiveaccept in class OsmPrimitivevisitor - The visitor from which the visit() function must be called.public void accept(PrimitiveVisitor visitor)
accept in interface IPrimitivepublic void cloneFrom(OsmPrimitive osm)
OsmPrimitivecloneFrom in class OsmPrimitivepublic void mergeFrom(OsmPrimitive other)
other onto this.
Both this and other must be new, or both must be assigned an OSM ID. If both this and other
have an assigend OSM id, the IDs have to be the same.mergeFrom in class OsmPrimitiveother - the other primitive. Must not be null.java.lang.IllegalArgumentException - thrown if other is null.DataIntegrityProblemException - thrown if either this is new and other is not, or other is new and this is notDataIntegrityProblemException - thrown if other is new and other.getId() != this.getId()public void load(PrimitiveData data)
OsmPrimitiveload in class OsmPrimitivedata - The object which should be clonedpublic NodeData save()
OsmPrimitivesave in class OsmPrimitivepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean hasEqualSemanticAttributes(OsmPrimitive other)
OsmPrimitivehasEqualSemanticAttributes in class OsmPrimitivepublic int compareTo(OsmPrimitive o)
compareTo in interface java.lang.Comparable<OsmPrimitive>public java.lang.String getDisplayName(NameFormatter formatter)
OsmPrimitiveformattergetDisplayName in class OsmPrimitivepublic OsmPrimitiveType getType()
PrimitiveIdgetType in interface PrimitiveIdNode,
Way,
Relationpublic BBox getBBox()
OsmPrimitivegetBBox in class OsmPrimitivepublic void updatePosition()
OsmPrimitiveupdatePosition in class OsmPrimitivepublic boolean isDrawable()
isDrawable in class OsmPrimitivepublic boolean isConnectionNode()
OsmPrimitive.isReferredByWays(int)public void invalidateEastNorthCache()
getEastNorth() is invoked
next time.public boolean concernsArea()
OsmPrimitiveconcernsArea in class OsmPrimitivetrue if this primitive semantically concerns an area, according to its type, geometry and tags, false otherwise.public boolean isConnectedTo(java.util.Collection<Node> otherNodes, int hops, Predicate<Node> predicate)
this node is connected to otherNode via at most hops nodes
matching the predicate (which may be null to consider all nodes).private boolean isConnectedTo(java.util.Collection<Node> otherNodes, int hops, Predicate<Node> predicate, java.util.Set<Node> visited)
public boolean isOutsideDownloadArea()
OsmPrimitiveDataSet.isOutsideDownloadArea in class OsmPrimitivetrue if this primitive lies outside of the downloaded area