|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openstreetmap.josm.data.osm.AbstractPrimitive
org.openstreetmap.josm.data.osm.OsmPrimitive
org.openstreetmap.josm.data.osm.Node
public final class Node
One node data, consisting of one world coordinate waypoint.
| Field Summary | |
|---|---|
private double |
east
|
private double |
lat
|
private double |
lon
|
private double |
north
|
| Fields inherited from class org.openstreetmap.josm.data.osm.OsmPrimitive |
|---|
allPredicate, 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, wayPredicate |
| Fields inherited from class org.openstreetmap.josm.data.osm.AbstractPrimitive |
|---|
changesetId, FLAG_DELETED, FLAG_INCOMPLETE, FLAG_MODIFIED, FLAG_VISIBLE, flags, id, keys, timestamp, user, version |
| Constructor Summary | |
|---|---|
|
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 clearId)
Constructs an identical clone of the argument. |
| Method Summary | |
|---|---|
void |
cloneFrom(OsmPrimitive osm)
Get and write all attributes from the parameter. |
int |
compareTo(OsmPrimitive o)
|
java.lang.String |
get3892DebugInfo()
Deprecated. This method will be remove by the end of 2012 if no report appears. |
BBox |
getBBox()
|
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 |
isConnectionNode()
Check whether this node connects 2 ways. |
boolean |
isDrawable()
|
private boolean |
isLatLonKnown()
|
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, ...) |
void |
visit(PrimitiveVisitor visitor)
|
void |
visit(Visitor visitor)
|
| Methods inherited from class org.openstreetmap.josm.data.osm.AbstractPrimitive |
|---|
cloneFrom, generateUniqueId, get, getChangesetId, getDisplayType, getId, getIgnoreCase, getKeys, getLocalName, getName, getPrimitiveId, getTimestamp, getUniqueId, getUser, getVersion, hasKey, hasKeys, hasSameTags, hasTag, hasTag, isDeleted, isIncomplete, isModified, isNew, isNewOrUndeleted, isTimestampEmpty, isUndeleted, isUsable, isVisible, keySet, setModified |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openstreetmap.josm.data.osm.IPrimitive |
|---|
getChangesetId, getId, getLocalName, getName, getPrimitiveId, getTimestamp, getUser, getVersion, isDeleted, isIncomplete, isModified, isNewOrUndeleted, isTimestampEmpty, isVisible, setChangesetId, setDeleted, setModified, setOsmId, setTimestamp, setUser, setVisible |
| Methods inherited from interface org.openstreetmap.josm.data.osm.Tagged |
|---|
get, getKeys, hasKeys, keySet, put, remove, removeAll, setKeys |
| Methods inherited from interface org.openstreetmap.josm.data.osm.PrimitiveId |
|---|
getUniqueId, isNew |
| Field Detail |
|---|
private double lat
private double lon
private double east
private double north
| Constructor Detail |
|---|
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 >= 0
java.lang.IllegalArgumentException - if id < 0
public Node(long id,
int version)
throws java.lang.IllegalArgumentException
Node with the given id and version.
id - The id. Must be >= 0version - The version
java.lang.IllegalArgumentException - if id < 0
public Node(Node clone,
boolean clearId)
clone - The node to cloneclearId - If true, set version to 0 and id to new unique valuepublic 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 Node(EastNorth eastNorth)
Node with the given east/north with id 0.
eastNorth - The EastNorth coordinates| Method Detail |
|---|
private boolean isLatLonKnown()
public final void setCoor(LatLon coor)
setCoor in interface INodepublic final void setEastNorth(EastNorth eastNorth)
setEastNorth in interface INode
private void updateCoor(LatLon coor,
EastNorth eastNorth)
public final LatLon getCoor()
getCoor in interface INodepublic 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)
OsmPrimitive
setDataset in class OsmPrimitivepublic void visit(Visitor visitor)
visit in class OsmPrimitivepublic void visit(PrimitiveVisitor visitor)
visit in interface IPrimitivepublic void cloneFrom(OsmPrimitive osm)
OsmPrimitive
cloneFrom 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 not
DataIntegrityProblemException - thrown if other is new and other.getId() != this.getId()public void load(PrimitiveData data)
OsmPrimitive
load in class OsmPrimitivepublic NodeData save()
OsmPrimitive
save in class OsmPrimitivepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean hasEqualSemanticAttributes(OsmPrimitive other)
OsmPrimitive
hasEqualSemanticAttributes in class OsmPrimitivepublic int compareTo(OsmPrimitive o)
compareTo in interface java.lang.Comparable<OsmPrimitive>public java.lang.String getDisplayName(NameFormatter formatter)
OsmPrimitiveformatter
getDisplayName in class OsmPrimitivepublic OsmPrimitiveType getType()
PrimitiveId
getType in interface PrimitiveIdNode,
Way,
Relationpublic BBox getBBox()
getBBox in class OsmPrimitivepublic void updatePosition()
OsmPrimitive
updatePosition in class OsmPrimitivepublic boolean isDrawable()
isDrawable in class OsmPrimitivepublic boolean isConnectionNode()
OsmPrimitive.isReferredByWays(int)public java.lang.String get3892DebugInfo()
public void invalidateEastNorthCache()
getEastNorth() is invoked
next time.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||