public abstract class IterableInterval<E extends Comparable<E>,S,U,ME extends IterableInterval<E,S,U,ME>> extends AbstractInterval<E,ME> implements IIterableInterval<E,S,U,ME>
| Constructor and Description |
|---|
IterableInterval(E left,
E right,
S step) |
IterableInterval(E left,
E right,
S step,
U unit,
boolean bLeftClosed,
boolean bRightClosed,
boolean bReverse) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
S |
getStep() |
U |
getUnit() |
int |
hashCode() |
Iterator<E> |
iterator() |
ME |
step(S s) |
String |
toString() |
ME |
unit(U u) |
contains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReverse, isRightClosedclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetFromLeft, getFromRight, iterateFromLeft, iterateFromRightforEach, spliteratorcontains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReverse, isRightClosedpublic Iterator<E> iterator()
iterator in interface IIterableInterval<E extends Comparable<E>,S,U,ME extends IterableInterval<E,S,U,ME>>iterator in interface Iterable<E extends Comparable<E>>IIterableInterval.iterateFromLeft(),
IIterableInterval.iterateFromRight()public S getStep()
getStep in interface IIterableInterval<E extends Comparable<E>,S,U,ME extends IterableInterval<E,S,U,ME>>For instance, if the interval is a set of decimal values, say [1..10], the step might be a decimal increment, say 0.25. Similarly, if the interval is simply a set of integers the step might also be an integer value, typically 1. Considering a date interval, say [4/5/10..5/20/10], the step could be expressed in terms of a unit of time e.g., 10 seconds, 1 minute, 2 weeks, etc.
Note if non-null, the step is a positive (or absolute) increment. To iterate the interval in reverse order use iterateFromRight().
public ME step(S s)
step in interface IIterableInterval<E extends Comparable<E>,S,U,ME extends IterableInterval<E,S,U,ME>>public U getUnit()
getUnit in interface IIterableInterval<E extends Comparable<E>,S,U,ME extends IterableInterval<E,S,U,ME>>public ME unit(U u)
unit in interface IIterableInterval<E extends Comparable<E>,S,U,ME extends IterableInterval<E,S,U,ME>>public boolean equals(Object o)
equals in class AbstractInterval<E extends Comparable<E>,ME extends IterableInterval<E,S,U,ME>>public int hashCode()
hashCode in class AbstractInterval<E extends Comparable<E>,ME extends IterableInterval<E,S,U,ME>>public String toString()
toString in class AbstractInterval<E extends Comparable<E>,ME extends IterableInterval<E,S,U,ME>>Copyright © 2022. All rights reserved.