Package org.openstreetmap.josm.data.osm
Class NodeData
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.AbstractPrimitive
-
- org.openstreetmap.josm.data.osm.PrimitiveData
-
- org.openstreetmap.josm.data.osm.NodeData
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<IPrimitive>
,ILatLon
,IQuadBucketType
,IFilterablePrimitive
,INode
,IPrimitive
,PrimitiveId
,Stylable
,Tagged
public class NodeData extends PrimitiveData implements INode
The data on a single node (tags and position) that is stored in the database- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static UniqueIdGenerator
idGenerator
private double
lat
private double
lon
private static long
serialVersionUID
-
Fields inherited from class org.openstreetmap.josm.data.osm.AbstractPrimitive
changesetId, FLAG_ALL_REFERRERS_DOWNLOADED, FLAG_ANNOTATED, FLAG_DELETED, FLAG_DIRECTION_REVERSED, FLAG_DISABLED, FLAG_DISABLED_TYPE, FLAG_HAS_DIRECTIONS, FLAG_HIDDEN_TYPE, FLAG_HIDE_IF_DISABLED, FLAG_HIGHLIGHTED, FLAG_INCOMPLETE, FLAG_MODIFIED, FLAG_PRESERVED, FLAG_TAGGED, FLAG_VISIBLE, flags, id, keys, mappaintCacheIdx, timestamp, user, version
-
Fields inherited from interface org.openstreetmap.josm.data.coor.ILatLon
MAX_SERVER_PRECISION
-
Fields inherited from interface org.openstreetmap.josm.data.osm.Tagged
MAX_TAG_LENGTH
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(PrimitiveVisitor visitor)
Makes the given visitor visit this primitive.BBox
getBBox()
Fetches the bounding box of the primitive.LatLon
getCoor()
Returns lat/lon coordinates of this node.UniqueIdGenerator
getIdGenerator()
Returns the unique identifier generator.OsmPrimitiveType
getType()
Gets the type of object represented by this object.boolean
isLatLonKnown()
Determines if this object has valid coordinates.boolean
isReferredByWays(int n)
Return true, if this primitive is referred by at least n waysdouble
lat()
Returns the latitude, i.e., the north-south position in degrees.double
lon()
Returns the longitude, i.e., the east-west position in degrees.NodeData
makeCopy()
Returns a copy of this primitive data.void
setCoor(LatLon coor)
Sets lat/lon coordinates of this node.void
setEastNorth(EastNorth eastNorth)
Sets east/north coordinates of this node.java.lang.String
toString()
-
Methods inherited from class org.openstreetmap.josm.data.osm.PrimitiveData
declareCachedStyleUpToDate, getCachedStyle, getDataSet, getReferrers, hasDirectionKeys, isAnnotated, isCachedStyleUpToDate, isHighlighted, isTagged, keysChangedImpl, reversedDirection, setCachedStyle, setHighlighted, setId, setIncomplete, setVersion, visitReferrers
-
Methods inherited from class org.openstreetmap.josm.data.osm.AbstractPrimitive
clearOsmMetadata, cloneFrom, doGet, get, getChangesetId, getDisabledType, getDiscardableKeys, getFlagsAsString, getHiddenType, getId, getIgnoreCase, getInstant, getInterestingTags, getKeys, getNumKeys, getRawTimestamp, getTimestamp, getUninterestingKeys, getUniqueId, getUser, getVersion, getWorkInProgressKeys, hasKey, hasKey, hasKeys, isDeleted, isDisabled, isDisabledAndHidden, isDrawable, isIncomplete, isModified, isNew, isNewOrUndeleted, isPreserved, isReferrersDownloaded, isTimestampEmpty, isUndeleted, isUninterestingKey, isUsable, isVisible, keys, keySet, put, putAll, remove, removeAll, setChangesetId, setDeleted, setDisabledState, setDisabledType, setHiddenType, setInstant, setKeys, setKeys, setModified, setOsmId, setRawTimestamp, setReferrersDownloaded, setTimestamp, setUser, setVisible, unsetDisabledState, updateFlags, updateFlagsChanged, visitKeys
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, getEastNorth, greatCircleDistance, interpolate
-
Methods inherited from interface org.openstreetmap.josm.data.osm.INode
compareTo, getDisplayName, getEastNorth, isConnectionNode
-
Methods inherited from interface org.openstreetmap.josm.data.osm.IPrimitive
getChangesetId, getChildren, getDataSet, getDisplayType, getId, getInstant, getInterestingTags, getLocalName, getName, getOsmId, getOsmPrimitiveId, getPrimitiveId, getRawTimestamp, getReferrers, getReferrers, getStyleCacheSyncObject, getTimestamp, getUser, getVersion, hasDirectionKeys, hasSameInterestingTags, isAnnotated, isDeleted, isDisabled, isDisabledAndHidden, isDrawable, isHighlighted, isIncomplete, isMemberOfSelected, isModified, isMultipolygon, isNewOrUndeleted, isOuterMemberOfSelected, isPreserved, isReferrersDownloaded, isSelectable, isSelected, isTagged, isTimestampEmpty, isUndeleted, isUsable, isVisible, reversedDirection, setChangesetId, setDeleted, setHighlighted, setInstant, setModified, setOsmId, setRawTimestamp, setReferrersDownloaded, setTimestamp, setUser, setVisible, visitReferrers
-
Methods inherited from interface org.openstreetmap.josm.data.osm.PrimitiveId
getUniqueId, isNew
-
Methods inherited from interface org.openstreetmap.josm.data.osm.Stylable
clearCachedStyle, declareCachedStyleUpToDate, getCachedStyle, isCachedStyleUpToDate, setCachedStyle
-
Methods inherited from interface org.openstreetmap.josm.data.osm.Tagged
get, getKeys, getNumKeys, hasKey, hasKeys, hasTag, hasTag, hasTag, hasTag, hasTagDifferent, hasTagDifferent, hasTagDifferent, isKeyFalse, isKeyTrue, keys, keySet, put, put, putAll, remove, removeAll, setKeys, visitKeys
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
idGenerator
private static final UniqueIdGenerator idGenerator
-
lat
private double lat
-
lon
private double lon
-
-
Method Detail
-
lat
public double lat()
Description copied from interface:ILatLon
Returns the latitude, i.e., the north-south position in degrees.- Specified by:
lat
in interfaceILatLon
- Returns:
- the latitude or NaN if
ILatLon.isLatLonKnown()
returns false
-
lon
public double lon()
Description copied from interface:ILatLon
Returns the longitude, i.e., the east-west position in degrees.- Specified by:
lon
in interfaceILatLon
- Returns:
- the longitude or NaN if
ILatLon.isLatLonKnown()
returns false
-
isLatLonKnown
public boolean isLatLonKnown()
Description copied from interface:ILatLon
Determines if this object has valid coordinates.- Specified by:
isLatLonKnown
in interfaceILatLon
- Returns:
true
if this object has valid coordinates
-
getCoor
public LatLon getCoor()
Description copied from interface:INode
Returns lat/lon coordinates of this node.
-
setCoor
public final void setCoor(LatLon coor)
Description copied from interface:INode
Sets lat/lon coordinates of this node.
-
setEastNorth
public void setEastNorth(EastNorth eastNorth)
Description copied from interface:INode
Sets east/north coordinates of this node.- Specified by:
setEastNorth
in interfaceINode
- Parameters:
eastNorth
- east/north coordinates of this node
-
makeCopy
public NodeData makeCopy()
Description copied from class:PrimitiveData
Returns a copy of this primitive data.- Specified by:
makeCopy
in classPrimitiveData
- Returns:
- a copy of this primitive data
-
toString
public java.lang.String toString()
- Overrides:
toString
in classPrimitiveData
-
getType
public OsmPrimitiveType getType()
Description copied from interface:PrimitiveId
Gets the type of object represented by this object. Note that this should return the base primitive type (OsmPrimitiveType.NODE
,OsmPrimitiveType.WAY
, andOsmPrimitiveType.RELATION
).- Specified by:
getType
in interfacePrimitiveId
- Returns:
- the object type
- See Also:
Node
,Way
,Relation
-
accept
public void accept(PrimitiveVisitor visitor)
Description copied from interface:IPrimitive
Makes the given visitor visit this primitive.- Specified by:
accept
in interfaceIPrimitive
- Parameters:
visitor
- visitor
-
getBBox
public BBox getBBox()
Description copied from interface:IPrimitive
Fetches the bounding box of the primitive. Since 17752, the returned bounding box might be immutable, i.e., modifying calls throw anUnsupportedOperationException
.- Specified by:
getBBox
in interfaceIPrimitive
- Specified by:
getBBox
in interfaceIQuadBucketType
- Returns:
- Bounding box of the object
-
isReferredByWays
public boolean isReferredByWays(int n)
Description copied from interface:INode
Return true, if this primitive is referred by at least n ways- Specified by:
isReferredByWays
in interfaceINode
- Parameters:
n
- Minimal number of ways to return true. Must be positive- Returns:
true
if this primitive is referred by at least n ways
-
getIdGenerator
public UniqueIdGenerator getIdGenerator()
Description copied from class:AbstractPrimitive
Returns the unique identifier generator.- Specified by:
getIdGenerator
in classAbstractPrimitive
- Returns:
- the unique identifier generator
-
-