com.dlsc.flexgantt.model.gantt
Class LinearSearchTimelineObjectIterator<T extends ITimelineObject>

java.lang.Object
  extended by com.dlsc.flexgantt.model.gantt.LinearSearchTimelineObjectIterator<T>
Type Parameters:
T - the type of the timeline objects
All Implemented Interfaces:
java.util.Iterator<T>

public class LinearSearchTimelineObjectIterator<T extends ITimelineObject>
extends java.lang.Object
implements java.util.Iterator<T>

Instances of this class are used to iterate over the sorted list of timeline objects returned by a timeline model. An iterator only returns those objects that intersect with the time span passed to the constructor of the iterator.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
LinearSearchTimelineObjectIterator(java.util.List<T> objectList, ITimeSpan span)
          Constructs a new iterator object.
LinearSearchTimelineObjectIterator(java.util.List<T> objectList, ITimeSpan span, boolean reverse)
          Constructs a new iterator object.
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearSearchTimelineObjectIterator

public LinearSearchTimelineObjectIterator(java.util.List<T> objectList,
                                          ITimeSpan span,
                                          boolean reverse)
Constructs a new iterator object.

Parameters:
objectList - the sorted list of timeline objectList
span - the time span to iterate over
reverse - determines the iteration direction (reverse = false = left to right = earlier to later, reverse = true = right to left)

LinearSearchTimelineObjectIterator

public LinearSearchTimelineObjectIterator(java.util.List<T> objectList,
                                          ITimeSpan span)
Constructs a new iterator object.

Parameters:
objectList - the sorted list of timeline objectList
span - the time span to iterate over
Method Detail

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<T extends ITimelineObject>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<T extends ITimelineObject>

next

public T next()
Specified by:
next in interface java.util.Iterator<T extends ITimelineObject>