public final class IntInterval
extends java.lang.Object
implements com.gs.collections.api.list.primitive.ImmutableIntList, java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
boolean |
anySatisfy(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
void |
appendString(java.lang.Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(java.lang.Appendable appendable,
java.lang.String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
Prints a string representation of this collection onto the given
Appendable. |
com.gs.collections.api.LazyIntIterable |
asLazy() |
com.gs.collections.api.LazyIntIterable |
asReversed() |
double |
average() |
IntInterval |
by(int newStep)
This instance
by method allows IntInterval to act as a fluent builder for itself. |
<V> com.gs.collections.api.list.ImmutableList<V> |
collect(com.gs.collections.api.block.function.primitive.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 of the specified int values.
|
boolean |
containsAll(com.gs.collections.api.IntIterable source) |
boolean |
containsNone(int... values)
Returns true if the IntInterval contains none of the specified int values.
|
int |
count(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
int |
detectIfNone(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate,
int ifNone) |
long |
dotProduct(com.gs.collections.api.list.primitive.IntList list) |
boolean |
equals(java.lang.Object otherList)
Follows the same general contract as
List.equals(Object). |
static IntInterval |
evensFromTo(int from,
int to)
Returns an IntInterval representing the even values from the value from to the value to.
|
void |
forEach(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure) |
void |
forEachWithIndex(com.gs.collections.api.block.procedure.primitive.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()
Follows the same general contract as
List.hashCode(). |
int |
indexOf(int value) |
<T> T |
injectInto(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectIntToObjectFunction<? super T,? extends T> function) |
<T> T |
injectIntoWithIndex(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectIntIntToObjectFunction<? super T,? extends T> function) |
com.gs.collections.api.iterator.IntIterator |
intIterator() |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
int |
lastIndexOf(int value) |
java.lang.String |
makeString()
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
java.lang.String |
makeString(java.lang.String separator)
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
java.lang.String |
makeString(java.lang.String start,
java.lang.String separator,
java.lang.String end)
Returns a string representation of this collection.
|
int |
max() |
int |
maxIfEmpty(int defaultValue) |
double |
median() |
int |
min() |
int |
minIfEmpty(int defaultValue) |
com.gs.collections.api.list.primitive.ImmutableIntList |
newWith(int element) |
com.gs.collections.api.list.primitive.ImmutableIntList |
newWithAll(com.gs.collections.api.IntIterable elements) |
com.gs.collections.api.list.primitive.ImmutableIntList |
newWithout(int element) |
com.gs.collections.api.list.primitive.ImmutableIntList |
newWithoutAll(com.gs.collections.api.IntIterable elements) |
boolean |
noneSatisfy(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
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.
|
com.gs.collections.api.list.primitive.ImmutableIntList |
reject(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
com.gs.collections.api.list.primitive.ImmutableIntList |
select(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
int |
size()
Calculates and returns the size of the interval.
|
com.gs.collections.api.list.primitive.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() |
com.gs.collections.api.bag.primitive.MutableIntBag |
toBag() |
com.gs.collections.api.list.primitive.ImmutableIntList |
toImmutable()
Returns an immutable copy of this list.
|
com.gs.collections.api.list.primitive.MutableIntList |
toList() |
IntInterval |
toReversed()
Returns a new IntInterval with the from and to values reversed and the step value negated.
|
com.gs.collections.api.set.primitive.MutableIntSet |
toSet() |
int[] |
toSortedArray() |
com.gs.collections.api.list.primitive.MutableIntList |
toSortedList() |
java.lang.String |
toString()
Returns a string representation of this PrimitiveIterable.
|
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.
|
public 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()
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 com.gs.collections.api.IntIterablepublic boolean containsAll(com.gs.collections.api.IntIterable source)
containsAll in interface com.gs.collections.api.IntIterablepublic boolean containsNone(int... values)
public boolean contains(int value)
contains in interface com.gs.collections.api.IntIterablepublic void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.IntIntProcedure procedure)
forEachWithIndex in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic void forEach(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure)
forEach in interface com.gs.collections.api.IntIterablepublic int count(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
count in interface com.gs.collections.api.IntIterablepublic boolean anySatisfy(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
anySatisfy in interface com.gs.collections.api.IntIterablepublic boolean allSatisfy(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
allSatisfy in interface com.gs.collections.api.IntIterablepublic boolean noneSatisfy(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
noneSatisfy in interface com.gs.collections.api.IntIterablepublic boolean equals(java.lang.Object otherList)
com.gs.collections.api.list.primitive.IntListList.equals(Object).equals in interface com.gs.collections.api.list.primitive.IntListequals in class java.lang.Objectpublic int hashCode()
com.gs.collections.api.list.primitive.IntListList.hashCode().hashCode in interface com.gs.collections.api.list.primitive.IntListhashCode in class java.lang.Objectpublic IntInterval toReversed()
toReversed in interface com.gs.collections.api.list.primitive.ImmutableIntListtoReversed in interface com.gs.collections.api.list.primitive.IntListtoReversed in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic com.gs.collections.api.list.primitive.ImmutableIntList subList(int fromIndex,
int toIndex)
subList in interface com.gs.collections.api.list.primitive.ImmutableIntListsubList in interface com.gs.collections.api.list.primitive.IntListList#subList(int fromIndex, int toIndex)}public int size()
size in interface com.gs.collections.api.PrimitiveIterablepublic long dotProduct(com.gs.collections.api.list.primitive.IntList list)
dotProduct in interface com.gs.collections.api.list.primitive.IntListpublic boolean isEmpty()
com.gs.collections.api.PrimitiveIterableisEmpty in interface com.gs.collections.api.PrimitiveIterablepublic boolean notEmpty()
com.gs.collections.api.PrimitiveIterablenotEmpty in interface com.gs.collections.api.PrimitiveIterablepublic java.lang.String makeString()
com.gs.collections.api.PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface com.gs.collections.api.PrimitiveIterablepublic java.lang.String makeString(java.lang.String separator)
com.gs.collections.api.PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface com.gs.collections.api.PrimitiveIterablepublic java.lang.String makeString(java.lang.String start,
java.lang.String separator,
java.lang.String end)
com.gs.collections.api.PrimitiveIterablemakeString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(java.lang.Appendable appendable)
com.gs.collections.api.PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(java.lang.Appendable appendable,
java.lang.String separator)
com.gs.collections.api.PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
com.gs.collections.api.PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface com.gs.collections.api.PrimitiveIterablepublic int[] toArray()
toArray in interface com.gs.collections.api.IntIterablepublic <T> T injectInto(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectIntToObjectFunction<? super T,? extends T> function)
injectInto in interface com.gs.collections.api.IntIterablepublic <T> T injectIntoWithIndex(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectIntIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic java.lang.String toString()
com.gs.collections.api.PrimitiveIterabletoString in interface com.gs.collections.api.PrimitiveIterabletoString in class java.lang.Objectpublic com.gs.collections.api.iterator.IntIterator intIterator()
intIterator in interface com.gs.collections.api.IntIterablepublic int getFirst()
getFirst in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic int getLast()
getLast in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic int get(int index)
get in interface com.gs.collections.api.list.primitive.IntListpublic int indexOf(int value)
indexOf in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic int lastIndexOf(int value)
lastIndexOf in interface com.gs.collections.api.list.primitive.IntListpublic com.gs.collections.api.list.primitive.ImmutableIntList select(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
select in interface com.gs.collections.api.collection.primitive.ImmutableIntCollectionselect in interface com.gs.collections.api.IntIterableselect in interface com.gs.collections.api.list.primitive.ImmutableIntListselect in interface com.gs.collections.api.list.primitive.IntListselect in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic com.gs.collections.api.list.primitive.ImmutableIntList reject(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
reject in interface com.gs.collections.api.collection.primitive.ImmutableIntCollectionreject in interface com.gs.collections.api.IntIterablereject in interface com.gs.collections.api.list.primitive.ImmutableIntListreject in interface com.gs.collections.api.list.primitive.IntListreject in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic int detectIfNone(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate,
int ifNone)
detectIfNone in interface com.gs.collections.api.IntIterablepublic <V> com.gs.collections.api.list.ImmutableList<V> collect(com.gs.collections.api.block.function.primitive.IntToObjectFunction<? extends V> function)
collect in interface com.gs.collections.api.collection.primitive.ImmutableIntCollectioncollect in interface com.gs.collections.api.IntIterablecollect in interface com.gs.collections.api.list.primitive.ImmutableIntListcollect in interface com.gs.collections.api.list.primitive.IntListcollect in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic com.gs.collections.api.LazyIntIterable asReversed()
asReversed in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic long sum()
sum in interface com.gs.collections.api.IntIterablepublic int max()
max in interface com.gs.collections.api.IntIterablepublic int min()
min in interface com.gs.collections.api.IntIterablepublic int minIfEmpty(int defaultValue)
minIfEmpty in interface com.gs.collections.api.IntIterablepublic int maxIfEmpty(int defaultValue)
maxIfEmpty in interface com.gs.collections.api.IntIterablepublic double average()
average in interface com.gs.collections.api.IntIterablepublic double median()
median in interface com.gs.collections.api.IntIterablepublic int[] toSortedArray()
toSortedArray in interface com.gs.collections.api.IntIterablepublic com.gs.collections.api.list.primitive.MutableIntList toList()
toList in interface com.gs.collections.api.IntIterablepublic com.gs.collections.api.list.primitive.MutableIntList toSortedList()
toSortedList in interface com.gs.collections.api.IntIterablepublic com.gs.collections.api.set.primitive.MutableIntSet toSet()
toSet in interface com.gs.collections.api.IntIterablepublic com.gs.collections.api.bag.primitive.MutableIntBag toBag()
toBag in interface com.gs.collections.api.IntIterablepublic com.gs.collections.api.LazyIntIterable asLazy()
asLazy in interface com.gs.collections.api.IntIterablepublic com.gs.collections.api.list.primitive.ImmutableIntList toImmutable()
com.gs.collections.api.list.primitive.IntListtoImmutable in interface com.gs.collections.api.list.primitive.IntListpublic com.gs.collections.api.list.primitive.ImmutableIntList newWith(int element)
newWith in interface com.gs.collections.api.collection.primitive.ImmutableIntCollectionnewWith in interface com.gs.collections.api.list.primitive.ImmutableIntListpublic com.gs.collections.api.list.primitive.ImmutableIntList newWithout(int element)
newWithout in interface com.gs.collections.api.collection.primitive.ImmutableIntCollectionnewWithout in interface com.gs.collections.api.list.primitive.ImmutableIntListpublic com.gs.collections.api.list.primitive.ImmutableIntList newWithAll(com.gs.collections.api.IntIterable elements)
newWithAll in interface com.gs.collections.api.collection.primitive.ImmutableIntCollectionnewWithAll in interface com.gs.collections.api.list.primitive.ImmutableIntListpublic com.gs.collections.api.list.primitive.ImmutableIntList newWithoutAll(com.gs.collections.api.IntIterable elements)
newWithoutAll in interface com.gs.collections.api.collection.primitive.ImmutableIntCollectionnewWithoutAll in interface com.gs.collections.api.list.primitive.ImmutableIntList