com.dlsc.flexgantt.model.gantt

## Class LinearSearchTimelineObjectIterator<T extends ITimelineObject>

- java.lang.Object
- - com.dlsc.flexgantt.model.gantt.LinearSearchTimelineObjectIterator<T>

- Type Parameters:
    `T` - the type of the timeline objects
  All Implemented Interfaces:
    Iterator<T>

      public class LinearSearchTimelineObjectIterator<T extends ITimelineObject>
      extends Object
      implements 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

    Constructors
    Constructor and Description
    `LinearSearchTimelineObjectIterator(List<T> objectList, ITimeSpan span)` Constructs a new iterator object.
    `LinearSearchTimelineObjectIterator(List<T> objectList, ITimeSpan span, boolean reverse)` Constructs a new iterator object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `T` | `next()`
    `void` | `remove()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Constructor Detail

    - #### LinearSearchTimelineObjectIterator

          public LinearSearchTimelineObjectIterator(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(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 `Iterator<T extends ITimelineObject>`

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<T extends ITimelineObject>`

    - #### next

          public T next()

      Specified by:
        `next` in interface `Iterator<T extends ITimelineObject>`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.