jfreerails.world.common
Class FreerailsPathIteratorImpl
java.lang.Object
jfreerails.world.common.FreerailsPathIteratorImpl
- All Implemented Interfaces:
- java.io.Serializable, FreerailsMutableSerializable, FreerailsPathIterator
public class FreerailsPathIteratorImpl
- extends java.lang.Object
- implements FreerailsPathIterator
Lets the caller access a series of Points as a series of IntLines.
- Author:
- Luke Lindsay
- See Also:
- Serialized Form
|
Constructor Summary |
FreerailsPathIteratorImpl(java.util.List<java.awt.Point> l,
boolean f)
Creates new FreerailsPathIteratorImpl |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
forwards
private final boolean forwards
position
private int position
points
private final java.util.List<java.awt.Point> points
FreerailsPathIteratorImpl
public FreerailsPathIteratorImpl(java.util.List<java.awt.Point> l,
boolean f)
- Creates new FreerailsPathIteratorImpl
forwardsIterator
public static FreerailsPathIterator forwardsIterator(java.util.List<java.awt.Point> l)
backwardsIterator
public static FreerailsPathIterator backwardsIterator(java.util.List<java.awt.Point> l)
hasNext
public boolean hasNext()
- Description copied from interface:
FreerailsPathIterator
- Tests whether the path has another segment.
- Specified by:
hasNext in interface FreerailsPathIterator
nextSegment
public void nextSegment(IntLine line)
- Description copied from interface:
FreerailsPathIterator
- Gets the next segment of the path and places its coordinates in the
specified IntLine; then moves the iterator forwards by one path segment.
(The coordinates are placed the passed-in IntLine rather than a new
object to avoid the cost of object creation.)
- Specified by:
nextSegment in interface FreerailsPathIterator