Package gw.lang.reflect.interval
Class BigDecimalInterval
- java.lang.Object
-
- gw.lang.reflect.interval.AbstractInterval<E,ME>
-
- gw.lang.reflect.interval.IterableInterval<E,E,Void,ME>
-
- gw.lang.reflect.interval.NumberInterval<BigDecimal,BigDecimalInterval>
-
- gw.lang.reflect.interval.BigDecimalInterval
-
- All Implemented Interfaces:
IInterval<BigDecimal,BigDecimalInterval>
,IIterableInterval<BigDecimal,BigDecimal,Void,BigDecimalInterval>
,Iterable<BigDecimal>
public final class BigDecimalInterval extends NumberInterval<BigDecimal,BigDecimalInterval>
-
-
Constructor Summary
Constructors Constructor Description BigDecimalInterval(BigDecimal left, BigDecimal right)
BigDecimalInterval(BigDecimal left, BigDecimal right, BigDecimal step, boolean bLeftClosed, boolean bRightClosed, boolean bReverse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
getFromLeft(int iStepIndex)
BigDecimal
getFromRight(int iStepIndex)
Iterator<BigDecimal>
iterateFromLeft()
Iterator<BigDecimal>
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
-
-
-
-
Constructor Detail
-
BigDecimalInterval
public BigDecimalInterval(BigDecimal left, BigDecimal right)
-
BigDecimalInterval
public BigDecimalInterval(BigDecimal left, BigDecimal right, BigDecimal step, boolean bLeftClosed, boolean bRightClosed, boolean bReverse)
-
-
Method Detail
-
iterateFromLeft
public Iterator<BigDecimal> 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<BigDecimal> 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 BigDecimal 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 BigDecimal 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.
-
-