public final class IntInterval extends Object implements ImmutableIntList, Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(IntPredicate predicate) |
boolean |
anySatisfy(IntPredicate predicate) |
void |
appendString(Appendable appendable) |
void |
appendString(Appendable appendable,
String separator) |
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
LazyIntIterable |
asLazy() |
LazyIntIterable |
asReversed() |
double |
average() |
int |
binarySearch(int value) |
IntInterval |
by(int newStep)
This instance
by method allows IntInterval to act as a fluent builder for itself. |
RichIterable<IntIterable> |
chunk(int size) |
<V> ImmutableList<V> |
collect(IntToObjectFunction<? extends V> function) |
boolean |
contains(int value)
Returns true if the IntInterval contains the specified int value.
|
boolean |
containsAll(int... values)
Returns true if the IntInterval contains all the specified int values.
|
boolean |
containsAll(IntIterable source) |
boolean |
containsNone(int... values)
Returns true if the IntInterval contains none of the specified int values.
|
int |
count(IntPredicate predicate) |
int |
detectIfNone(IntPredicate predicate,
int ifNone) |
ImmutableIntList |
distinct() |
long |
dotProduct(IntList list) |
void |
each(IntProcedure procedure) |
boolean |
equals(Object otherList) |
static IntInterval |
evensFromTo(int from,
int to)
Returns an IntInterval representing the even values from the value from to the value to.
|
void |
forEachWithIndex(IntIntProcedure procedure) |
static IntInterval |
from(int newFrom)
This static
from method allows IntInterval to act as a fluent builder for itself. |
static IntInterval |
fromTo(int from,
int to)
Returns an IntInterval starting from the value from to the specified value to with a step value of 1.
|
static IntInterval |
fromToBy(int from,
int to,
int stepBy)
Returns an IntInterval for the range of integers inclusively between from and to with the specified
stepBy value.
|
int |
get(int index) |
int |
getFirst() |
int |
getLast() |
int |
hashCode() |
int |
indexOf(int value) |
<T> T |
injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function) |
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectIntIntToObjectFunction<? super T,? extends T> function) |
IntIterator |
intIterator() |
boolean |
isEmpty() |
int |
lastIndexOf(int value) |
String |
makeString() |
String |
makeString(String separator) |
String |
makeString(String start,
String separator,
String end) |
int |
max() |
int |
maxIfEmpty(int defaultValue) |
double |
median() |
int |
min() |
int |
minIfEmpty(int defaultValue) |
ImmutableIntList |
newWith(int element) |
ImmutableIntList |
newWithAll(IntIterable elements) |
ImmutableIntList |
newWithout(int element) |
ImmutableIntList |
newWithoutAll(IntIterable elements) |
boolean |
notEmpty() |
static IntInterval |
oddsFromTo(int from,
int to)
Returns an IntInterval representing the odd values from the value from to the value to.
|
static IntInterval |
oneTo(int count)
Returns an IntInterval starting from 1 to the specified count value with a step value of 1.
|
static IntInterval |
oneToBy(int count,
int step)
Returns an IntInterval starting from 1 to the specified count value with a step value of step.
|
ImmutableIntList |
reject(IntPredicate predicate) |
ImmutableIntList |
select(IntPredicate predicate) |
int |
size()
Returns the size of the interval.
|
Spliterator.OfInt |
spliterator() |
ImmutableIntList |
subList(int fromIndex,
int toIndex) |
long |
sum() |
IntInterval |
to(int newTo)
This instance
to method allows IntInterval to act as a fluent builder for itself. |
int[] |
toArray() |
int[] |
toArray(int[] result) |
MutableIntBag |
toBag() |
ImmutableIntList |
toImmutable() |
MutableIntList |
toList() |
IntInterval |
toReversed()
Returns a new IntInterval with the from and to values reversed and the step value negated.
|
MutableIntSet |
toSet() |
int[] |
toSortedArray() |
MutableIntList |
toSortedList() |
String |
toString() |
static IntInterval |
zero()
Returns an IntInterval starting at zero.
|
static IntInterval |
zeroTo(int count)
Returns an IntInterval starting from 0 to the specified count value with a step value of 1.
|
static IntInterval |
zeroToBy(int count,
int step)
Returns an IntInterval starting from 0 to the specified count value with a step value of step.
|
<T> ImmutableList<IntObjectPair<T>> |
zip(Iterable<T> iterable) |
ImmutableList<IntIntPair> |
zipInt(IntIterable iterable) |
collectWithIndex, rejectWithIndex, selectWithIndex, tapforEachInBoth, primitiveParallelStream, primitiveStreamcollectWithIndex, rejectWithIndex, selectWithIndexaverageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, medianIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedList, toSortedListBy, toSortedListBypublic static IntInterval from(int newFrom)
from method allows IntInterval to act as a fluent builder for itself.
It works in conjunction with the instance methods to(int) and by(int).
Usage Example:
IntInterval interval1 = IntInterval.from(1).to(5); // results in: 1, 2, 3, 4, 5. IntInterval interval2 = IntInterval.from(1).to(10).by(2); // results in: 1, 3, 5, 7, 9.
public IntInterval to(int newTo)
to method allows IntInterval to act as a fluent builder for itself.
It works in conjunction with the static method from(int) and instance method by(int).
Usage Example:
IntInterval interval1 = IntInterval.from(1).to(5); // results in: 1, 2, 3, 4, 5. IntInterval interval2 = IntInterval.from(1).to(10).by(2); // results in: 1, 3, 5, 7, 9.
public IntInterval by(int newStep)
by method allows IntInterval to act as a fluent builder for itself.
It works in conjunction with the static method from(int) and instance method to(int).
Usage Example:
IntInterval interval1 = IntInterval.from(1).to(5); // results in: 1, 2, 3, 4, 5. IntInterval interval2 = IntInterval.from(1).to(10).by(2); // results in: 1, 3, 5, 7, 9.
public static IntInterval zero()
Usage Example:
IntInterval interval1 = IntInterval.zero().to(5); // results in: 0, 1, 2, 3, 4, 5. IntInterval interval2 = IntInterval.zero().to(10).by(2); // results in: 0, 2, 4, 6, 8, 10.
public static IntInterval oneTo(int count)
public static IntInterval oneToBy(int count, int step)
public static IntInterval zeroTo(int count)
public static IntInterval zeroToBy(int count, int step)
public static IntInterval fromTo(int from, int to)
public static IntInterval evensFromTo(int from, int to)
public static IntInterval oddsFromTo(int from, int to)
public static IntInterval fromToBy(int from, int to, int stepBy)
public boolean containsAll(int... values)
containsAll in interface IntIterablepublic boolean containsAll(IntIterable source)
containsAll in interface IntIterablepublic boolean containsNone(int... values)
containsNone in interface IntIterablepublic boolean contains(int value)
contains in interface IntIterablepublic void forEachWithIndex(IntIntProcedure procedure)
forEachWithIndex in interface OrderedIntIterablepublic void each(IntProcedure procedure)
each in interface IntIterablepublic int count(IntPredicate predicate)
count in interface IntIterablepublic boolean anySatisfy(IntPredicate predicate)
anySatisfy in interface IntIterablepublic boolean allSatisfy(IntPredicate predicate)
allSatisfy in interface IntIterablepublic boolean equals(Object otherList)
public int hashCode()
public IntInterval toReversed()
toReversed in interface ImmutableIntListtoReversed in interface IntListtoReversed in interface ReversibleIntIterablepublic ImmutableIntList distinct()
distinct in interface ImmutableIntListdistinct in interface IntListdistinct in interface ReversibleIntIterablepublic ImmutableIntList subList(int fromIndex, int toIndex)
subList in interface ImmutableIntListsubList in interface IntListpublic int size()
size in interface PrimitiveIterablepublic long dotProduct(IntList list)
dotProduct in interface IntListpublic boolean isEmpty()
isEmpty in interface PrimitiveIterablepublic boolean notEmpty()
notEmpty in interface PrimitiveIterablepublic String makeString()
makeString in interface PrimitiveIterablepublic String makeString(String separator)
makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
makeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
appendString in interface PrimitiveIterablepublic int[] toArray()
toArray in interface IntIterablepublic int[] toArray(int[] result)
toArray in interface IntIterablepublic <T> T injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function)
injectInto in interface IntIterablepublic <T> T injectIntoWithIndex(T injectedValue,
ObjectIntIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface OrderedIntIterableinjectIntoWithIndex in interface ReversibleIntIterablepublic RichIterable<IntIterable> chunk(int size)
chunk in interface IntIterablepublic String toString()
toString in interface PrimitiveIterabletoString in class Objectpublic IntIterator intIterator()
intIterator in interface IntIterablepublic int getFirst()
getFirst in interface OrderedIntIterablepublic int getLast()
getLast in interface ReversibleIntIterablepublic int indexOf(int value)
indexOf in interface OrderedIntIterablepublic int lastIndexOf(int value)
lastIndexOf in interface IntListpublic ImmutableIntList select(IntPredicate predicate)
select in interface ImmutableIntCollectionselect in interface IntIterableselect in interface ImmutableIntListselect in interface IntListselect in interface OrderedIntIterableselect in interface ReversibleIntIterablepublic ImmutableIntList reject(IntPredicate predicate)
reject in interface ImmutableIntCollectionreject in interface IntIterablereject in interface ImmutableIntListreject in interface IntListreject in interface OrderedIntIterablereject in interface ReversibleIntIterablepublic int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone in interface IntIterablepublic <V> ImmutableList<V> collect(IntToObjectFunction<? extends V> function)
collect in interface ImmutableIntCollectioncollect in interface IntIterablecollect in interface ImmutableIntListcollect in interface IntListcollect in interface OrderedIntIterablecollect in interface ReversibleIntIterablepublic LazyIntIterable asReversed()
asReversed in interface ReversibleIntIterablepublic long sum()
sum in interface IntIterablepublic int max()
max in interface IntIterablepublic int min()
min in interface IntIterablepublic int minIfEmpty(int defaultValue)
minIfEmpty in interface IntIterablepublic int maxIfEmpty(int defaultValue)
maxIfEmpty in interface IntIterablepublic double average()
average in interface IntIterablepublic double median()
median in interface IntIterablepublic int binarySearch(int value)
binarySearch in interface IntListpublic int[] toSortedArray()
toSortedArray in interface IntIterablepublic MutableIntList toList()
toList in interface IntIterablepublic MutableIntList toSortedList()
toSortedList in interface IntIterablepublic MutableIntSet toSet()
toSet in interface IntIterablepublic MutableIntBag toBag()
toBag in interface IntIterablepublic LazyIntIterable asLazy()
asLazy in interface IntIterablepublic ImmutableIntList toImmutable()
toImmutable in interface IntListpublic ImmutableIntList newWith(int element)
newWith in interface ImmutableIntCollectionnewWith in interface ImmutableIntListpublic ImmutableIntList newWithout(int element)
newWithout in interface ImmutableIntCollectionnewWithout in interface ImmutableIntListpublic ImmutableIntList newWithAll(IntIterable elements)
newWithAll in interface ImmutableIntCollectionnewWithAll in interface ImmutableIntListpublic ImmutableIntList newWithoutAll(IntIterable elements)
newWithoutAll in interface ImmutableIntCollectionnewWithoutAll in interface ImmutableIntListpublic ImmutableList<IntIntPair> zipInt(IntIterable iterable)
zipInt in interface ImmutableIntListzipInt in interface IntListpublic <T> ImmutableList<IntObjectPair<T>> zip(Iterable<T> iterable)
zip in interface ImmutableIntListzip in interface IntListpublic Spliterator.OfInt spliterator()
spliterator in interface IntListCopyright © 2004–2022. All rights reserved.