Package gw.lang.reflect.interval
Class DateInterval
- java.lang.Object
-
- gw.lang.reflect.interval.AbstractInterval<E,ME>
-
- gw.lang.reflect.interval.IterableInterval<Date,Integer,DateUnit,DateInterval>
-
- gw.lang.reflect.interval.DateInterval
-
- All Implemented Interfaces:
IInterval<Date,DateInterval>
,IIterableInterval<Date,Integer,DateUnit,DateInterval>
,Iterable<Date>
public class DateInterval extends IterableInterval<Date,Integer,DateUnit,DateInterval>
-
-
Constructor Summary
Constructors Constructor Description DateInterval(Date left, Date right, int iStep, DateUnit unit, boolean bLeftClosed, boolean bRightClosed, boolean bReverse)
DateInterval(Date left, Date right, Integer step, DateUnit unit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Date
getFromLeft(int iStepIndex)
Date
getFromRight(int iStepIndex)
Iterator<Date>
iterateFromLeft()
Iterator<Date>
iterateFromRight()
-
Methods inherited from class gw.lang.reflect.interval.IterableInterval
equals, getStep, getUnit, hashCode, iterator, step, toString, unit
-
Methods inherited from class gw.lang.reflect.interval.AbstractInterval
contains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReverse, isRightClosed
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.interval.IInterval
contains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReverse, isRightClosed
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
iterateFromLeft
public Iterator<Date> 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:
IIterableInterval.iterator()
,IIterableInterval.iterateFromRight()
-
iterateFromRight
public Iterator<Date> 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:
IIterableInterval.iterator()
,IIterableInterval.iterateFromLeft()
-
getFromLeft
public Date 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 Date 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.
-
-