Package org.openstreetmap.josm.data.osm
Class WaySegment
- All Implemented Interfaces:
Comparable<IWaySegment<Node,Way>>
A segment consisting of two consecutive nodes out of a way.
-
Field Summary
Fields inherited from class org.openstreetmap.josm.data.osm.IWaySegment
NOT_A_SEGMENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WaySegmentforNodePair(Way way, Node first, Node second) Determines and returns the way segment for the given way and node pair.toString()toWay()Returns this way segment as complete way.Methods inherited from class org.openstreetmap.josm.data.osm.IWaySegment
compareTo, equals, forNodePair, getFirstNode, getLowerIndex, getSecondNode, getUpperIndex, getWay, hashCode, intersects, isSimilar, isUsable
-
Constructor Details
-
WaySegment
Constructs a newIWaySegment.- Parameters:
way- The wayi- The node lower index- Throws:
IllegalArgumentException- in case of invalid index
-
-
Method Details
-
forNodePair
Determines and returns the way segment for the given way and node pair. You should preferIWaySegment.forNodePair(IWay, INode, INode)whenever possible.- Parameters:
way- wayfirst- first nodesecond- second node- Returns:
- way segment
- Throws:
IllegalArgumentException- if the node pair is not single a segment of the way
-
toWay
Returns this way segment as complete way.- Overrides:
toWayin classIWaySegment<Node,Way> - Returns:
- the way segment as
Way
-
toString
- Overrides:
toStringin classIWaySegment<Node,Way>
-