com.ibm.tivoli.maximo.util

Class IterableRange

  • java.lang.Object
    • com.ibm.tivoli.maximo.util.IterableRange
  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Iterator


    public class IterableRange
    extends java.lang.Object
    implements java.lang.Iterable, java.util.Iterator
    This is both an Iterator and Iterable for Range items. You give it a List of T objects and this iterator will expose them as Range objects for stand and end ranges. (ie, every Pair of T's is Range, provided they are within the start/end inclusion initial range. if you use "shiftByOne=true" then it will skip the first T, create a range pattern that basically goes from the end of the first range pair to the start of the next pair.
    • Constructor Summary

      Constructors 
      Constructor and Description
      IterableRange(java.util.Iterator iterator, boolean shift)
      Lists of T's to put into the Iterator.
      IterableRange(java.util.List data, boolean shiftByOne)
      Lists of T's to put into the Iterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean hasNext() 
      java.util.Iterator iterator() 
      Range next()
      the Range object is reused for each .next() operation.
      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.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • IterableRange

        public IterableRange(java.util.Iterator iterator,
                             boolean shift)
        Lists of T's to put into the Iterator.
        Parameters:
        iterator -
        shift - if true, the first date is skipped to create an offset pattern
      • IterableRange

        public IterableRange(java.util.List data,
                             boolean shiftByOne)
        Lists of T's to put into the Iterator.
        Parameters:
        data -
        shiftByOne - if true, the first date is skipped to create an offset pattern
    • Method Detail

      • iterator

        public java.util.Iterator iterator()
        Specified by:
        iterator in interface java.lang.Iterable
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator
      • next

        public Range next()
        the Range object is reused for each .next() operation. If you need to hold onto the Range value, then use the Range.copy() to create a copy of the range.
        Specified by:
        next in interface java.util.Iterator
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator