public abstract class AbstractIterableRange<E extends Comparable<E>,S,U,ME extends AbstractIterableRange<E,S,U,ME>> extends AbstractRange<E,ME> implements IterableRange<E,S,U,ME>
| Constructor and Description |
|---|
AbstractIterableRange(E left,
E right,
S step) |
AbstractIterableRange(E left,
E right,
S step,
U unit,
boolean leftClosed,
boolean rightClosed,
boolean reverse) |
| 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, isReversed, isRightClosedclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetFromLeft, getFromRight, iterateFromLeft, iterateFromRightforEach, spliteratorcontains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReversed, isRightClosedpublic Iterator<E> iterator()
iterator in interface Iterable<E extends Comparable<E>>iterator in interface IterableRange<E extends Comparable<E>,S,U,ME extends AbstractIterableRange<E,S,U,ME>>IterableRange.iterateFromLeft(),
IterableRange.iterateFromRight()public S getStep()
getStep in interface IterableRange<E extends Comparable<E>,S,U,ME extends AbstractIterableRange<E,S,U,ME>>For instance, if the range is a set of decimal values, say [1..10], the step might be a decimal increment, say 0.25. Similarly, if the range is simply a set of integers the step might also be an integer value, typically 1. Considering a date range, 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 range in reverse order use iterateFromRight().
public ME step(S s)
step in interface IterableRange<E extends Comparable<E>,S,U,ME extends AbstractIterableRange<E,S,U,ME>>public U getUnit()
getUnit in interface IterableRange<E extends Comparable<E>,S,U,ME extends AbstractIterableRange<E,S,U,ME>>public ME unit(U u)
unit in interface IterableRange<E extends Comparable<E>,S,U,ME extends AbstractIterableRange<E,S,U,ME>>public boolean equals(Object o)
equals in class AbstractRange<E extends Comparable<E>,ME extends AbstractIterableRange<E,S,U,ME>>public int hashCode()
hashCode in class AbstractRange<E extends Comparable<E>,ME extends AbstractIterableRange<E,S,U,ME>>public String toString()
toString in class AbstractRange<E extends Comparable<E>,ME extends AbstractIterableRange<E,S,U,ME>>Copyright © 2020. All rights reserved.