Class OffsetIterator
java.lang.Object
org.openstreetmap.josm.data.osm.visitor.paint.OffsetIterator
- All Implemented Interfaces:
Iterator<MapViewState.MapViewPoint>
Iterates over a list of Way Nodes and returns screen coordinates that
represent a line that is shifted by a certain offset perpendicular
to the way direction.
There is no intention, to handle consecutive duplicate Nodes in a
perfect way, but it should not throw an exception.
- Since:
- 11696 made public
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final MapViewStateprivate final List<MapViewState.MapViewPoint>private final doubleprivate MapViewState.MapViewPointprivate doubleprivate double -
Constructor Summary
ConstructorsConstructorDescriptionOffsetIterator(List<MapViewState.MapViewPoint> nodes, double offset) Creates a new offset iteratorOffsetIterator(MapViewState mapState, List<? extends INode> nodes, double offset) Creates a new offset iterator -
Method Summary
Modifier and TypeMethodDescriptionprivate MapViewState.MapViewPointgetForIndex(int i) booleanhasNext()next()voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
mapState
-
nodes
-
offset
-
idx
-
prev
-
xPrev0
-
yPrev0
-
-
Constructor Details
-
OffsetIterator
Creates a new offset iterator- Parameters:
nodes- The nodes of the original lineoffset- The offset of the line.
-
OffsetIterator
Creates a new offset iterator- Parameters:
mapState- The map view state this iterator is for.nodes- The nodes of the original lineoffset- The offset of the line.
-
-
Method Details
-
hasNext
- Specified by:
hasNextin interfaceIterator<MapViewState.MapViewPoint>
-
next
- Specified by:
nextin interfaceIterator<MapViewState.MapViewPoint>
-
getForIndex
-
remove
- Specified by:
removein interfaceIterator<MapViewState.MapViewPoint>
-