jfreerails.controller
Class ToAndFroPathIterator

java.lang.Object
  extended by jfreerails.controller.ToAndFroPathIterator
All Implemented Interfaces:
java.io.Serializable, FreerailsMutableSerializable, FreerailsPathIterator

public class ToAndFroPathIterator
extends java.lang.Object
implements FreerailsPathIterator

Returns a path that goes forwards and backwards along the path passed to its constructor.

Author:
Luke Lindsay 30-Oct-2002
See Also:
Serialized Form

Field Summary
private  boolean forwards
           
private  java.util.List<java.awt.Point> list
           
private  FreerailsPathIterator path
           
private static long serialVersionUID
           
 
Constructor Summary
ToAndFroPathIterator(java.util.List<java.awt.Point> l)
           
 
Method Summary
 boolean hasNext()
          Tests whether the path has another segment.
private  void nextIterator()
           
 void nextSegment(IntLine line)
          Gets the next segment of the path and places its coordinates in the specified IntLine; then moves the iterator forwards by one path segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

path

private FreerailsPathIterator path

forwards

private boolean forwards

list

private final java.util.List<java.awt.Point> list
Constructor Detail

ToAndFroPathIterator

public ToAndFroPathIterator(java.util.List<java.awt.Point> l)
Method Detail

nextIterator

private void nextIterator()

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