Class SequenceableInterval<E extends ISequenceable<E,S,U> & Comparable<E>,S,U>

All Implemented Interfaces:
IInterval<E,SequenceableInterval<E,S,U>>, IIterableInterval<E,S,U,SequenceableInterval<E,S,U>>, Iterable<E>

public class SequenceableInterval<E extends ISequenceable<E,S,U> & Comparable<E>,S,U> extends IterableInterval<E,S,U,SequenceableInterval<E,S,U>>
  • Constructor Details

    • SequenceableInterval

      public SequenceableInterval(E left, E right, S step, U unit, boolean bLeftClosed, boolean bRightClosed, boolean bReverse)
  • Method Details

    • iterateFromLeft

      public Iterator<E> iterateFromLeft()
      Returns:
      An iterator that visits the elements in this interval in order, from left to right. Returns null if this interval does not support iteration.
      See Also:
    • iterateFromRight

      public Iterator<E> iterateFromRight()
      Returns:
      An iterator that visits the elements in this interval in reverse order, from right to left. Returns null if this interval does not support iteration.
      See Also:
    • getFromLeft

      public E getFromLeft(int iStepIndex)
      Parameters:
      iStepIndex - The index of the step from the left endpoint
      Returns:
      The nth step from the left endpoint. Returns null if iStepIndex is out of bounds.
    • getFromRight

      public E getFromRight(int iStepIndex)
      Parameters:
      iStepIndex - The index of the step from the right endpoint
      Returns:
      The nth step from the right endpoint. Returns null if iStepIndex is out of bounds.