Class VectorWay
java.lang.Object
org.openstreetmap.josm.data.osm.AbstractPrimitive
org.openstreetmap.josm.data.vector.VectorPrimitive
org.openstreetmap.josm.data.vector.VectorWay
- All Implemented Interfaces:
Comparable<IPrimitive>,IQuadBucketType,IFilterablePrimitive,IPrimitive,IWay<VectorNode>,PrimitiveId,Stylable,Tagged,DataLayer<String>
The "Way" type for a Vector layer
- Since:
- 17862
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BBoxprivate final List<VectorNode>private static final UniqueIdGeneratorFields 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, versionFields inherited from interface org.openstreetmap.josm.data.osm.Tagged
MAX_TAG_LENGTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(PrimitiveVisitor visitor) Makes the given visitor visit this primitive.Returns the first node of this way.getBBox()Fetches the bounding box of the primitive.Gets the type this primitive is displayed atReturns the unique identifier generator.getNode(int index) Replies the node at positionindex.longgetNodeId(int idx) Returns id of the node at given index.Returns the list of node ids in this way.getNodes()Returns the list of nodes in this way.intReplies the number of nodes in this way.getType()Gets the type of object represented by this object.booleanisClosed()Determines if this way is closed.booleanReplies true if the given node is the first or the last one of this way, false otherwise.booleanisInnerNode(INode n) Replies true if the given node is an inner node of this way, false otherwise.lastNode()Returns the last node of this way.voidsetNodes(List<VectorNode> nodes) Set new list of nodes to way.Methods inherited from class org.openstreetmap.josm.data.vector.VectorPrimitive
addReferrer, clearCachedStyle, declareCachedStyleUpToDate, getCachedStyle, getDataSet, getLayer, getReferrers, hasDirectionKeys, isAnnotated, isCachedStyleUpToDate, isHighlighted, keysChangedImpl, referrers, removeReferrer, reversedDirection, setCachedStyle, setDataSet, setDisabled, setHighlighted, setId, setVisible, visitReferrersMethods 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, getUninterestingKeys, getUniqueId, getUser, getVersion, getWorkInProgressKeys, hasKey, hasKey, hasKeys, isDeleted, isDisabled, isDisabledAndHidden, isDrawable, isIncomplete, isModified, isNew, isNewOrUndeleted, isPreserved, isReferrersDownloaded, isTagged, isTimestampEmpty, isUndeleted, isUninterestingKey, isUsable, isVisible, keys, keySet, put, putAll, remove, removeAll, setChangesetId, setDeleted, setDisabledState, setDisabledType, setHiddenType, setIncomplete, setInstant, setKeys, setKeys, setModified, setOsmId, setRawTimestamp, setReferrersDownloaded, setUser, unsetDisabledState, updateFlags, updateFlagsChanged, visitKeysMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.osm.IPrimitive
getChangesetId, getDataSet, getId, getInstant, getInterestingTags, getLocalName, getName, getOsmId, getOsmPrimitiveId, getPrimitiveId, getRawTimestamp, getReferrers, getReferrers, getStyleCacheSyncObject, 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, setUser, setVisible, visitReferrersMethods inherited from interface org.openstreetmap.josm.data.osm.IWay
compareTo, getChildren, getDisplayName, getRealNodesCount, hasIncompleteNodes, isEmptyMethods inherited from interface org.openstreetmap.josm.data.osm.PrimitiveId
getUniqueId, isNewMethods inherited from interface org.openstreetmap.josm.data.osm.Stylable
clearCachedStyle, declareCachedStyleUpToDate, getCachedStyle, isCachedStyleUpToDate, setCachedStyleMethods 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 Details
-
WAY_GENERATOR
-
nodes
-
cachedBBox
-
-
Constructor Details
-
VectorWay
Create a new way for a layer- Parameters:
layer- The layer for the way
-
-
Method Details
-
getIdGenerator
Description copied from class:AbstractPrimitiveReturns the unique identifier generator.- Specified by:
getIdGeneratorin classAbstractPrimitive- Returns:
- the unique identifier generator
-
accept
Description copied from interface:IPrimitiveMakes the given visitor visit this primitive.- Specified by:
acceptin interfaceIPrimitive- Parameters:
visitor- visitor
-
getBBox
Description copied from interface:IPrimitiveFetches the bounding box of the primitive. Since 17752, the returned bounding box might be immutable, i.e., modifying calls throw anUnsupportedOperationException.- Specified by:
getBBoxin interfaceIPrimitive- Specified by:
getBBoxin interfaceIQuadBucketType- Returns:
- Bounding box of the object
-
getNodesCount
Description copied from interface:IWayReplies the number of nodes in this way.- Specified by:
getNodesCountin interfaceIWay<VectorNode>- Returns:
- the number of nodes in this way.
-
getNode
Description copied from interface:IWayReplies the node at positionindex.- Specified by:
getNodein interfaceIWay<VectorNode>- Parameters:
index- the position- Returns:
- the node at position
index
-
getNodes
Description copied from interface:IWayReturns the list of nodes in this way.- Specified by:
getNodesin interfaceIWay<VectorNode>- Returns:
- the list of nodes in this way
-
setNodes
Description copied from interface:IWaySet new list of nodes to way. This method is preferred to multiple calls to addNode/removeNode and similar methods because nodes are internally saved as array which means lower memory overhead but also slower modifying operations.- Specified by:
setNodesin interfaceIWay<VectorNode>- Parameters:
nodes- New way nodes. Can be null, in that case all way nodes are removed
-
getNodeIds
Description copied from interface:IWayReturns the list of node ids in this way.- Specified by:
getNodeIdsin interfaceIWay<VectorNode>- Returns:
- the list of node ids in this way
-
getNodeId
Description copied from interface:IWayReturns id of the node at given index.- Specified by:
getNodeIdin interfaceIWay<VectorNode>- Parameters:
idx- node index- Returns:
- id of the node at given index
-
isClosed
Description copied from interface:IWayDetermines if this way is closed.- Specified by:
isClosedin interfaceIWay<VectorNode>- Returns:
trueif this way is closed,falseotherwise
-
firstNode
Description copied from interface:IWayReturns the first node of this way. The result equalsgetNode(0).- Specified by:
firstNodein interfaceIWay<VectorNode>- Returns:
- the first node of this way
-
lastNode
Description copied from interface:IWayReturns the last node of this way. The result equals.getNode(getNodesCount- 1)- Specified by:
lastNodein interfaceIWay<VectorNode>- Returns:
- the last node of this way
-
isFirstLastNode
Description copied from interface:IWayReplies true if the given node is the first or the last one of this way, false otherwise.- Specified by:
isFirstLastNodein interfaceIWay<VectorNode>- Parameters:
n- The node to test- Returns:
- true if the
nis the first or the last node, false otherwise.
-
isInnerNode
Description copied from interface:IWayReplies true if the given node is an inner node of this way, false otherwise.- Specified by:
isInnerNodein interfaceIWay<VectorNode>- Parameters:
n- The node to test- Returns:
- true if the
nis an inner node, false otherwise.
-
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).- Specified by:
getTypein interfacePrimitiveId- Returns:
- the object type
- See Also:
-
getDisplayType
Description copied from interface:IPrimitiveGets the type this primitive is displayed at- Specified by:
getDisplayTypein interfaceIPrimitive- Returns:
- A
OsmPrimitiveType
-