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, isRightClosed
clone, emptyArray, finalize, getClass, jailbreak, notify, notifyAll, wait, wait, wait
getFromLeft, getFromRight, iterateFromLeft, iterateFromRight
count, count, distinctBy, distinctList, filterIndexedTo, filterIndexedToList, filterNotTo, filterNotToList, filterTo, filterToList, first, first, firstOrNull, firstOrNull, flatMap, flatMapTo, fold, forEach, forEachIndexed, indexOfFirst, indexOfLast, intersect, joinTo, joinToString, last, last, lastOrNull, lastOrNull, mapIndexed, mapIndexedNotNull, mapIndexedNotNullTo, mapIndexedNotNullToList, mapIndexedTo, mapIndexedToList, mapNotNull, mapNotNullTo, mapNotNullToList, mapTo, mapToList, maxWith, minWith, partition, reversed, single, single, singleOrNull, singleOrNull, spliterator, subList, subList, subtract, toList, toSet, union
contains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReversed, isRightClosed
public 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 © 2024. All rights reserved.