public final class IntInterval extends Object implements com.gs.collections.api.list.primitive.ImmutableIntList, 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(Appendable appendable) |
void |
appendString(Appendable appendable,
String separator) |
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
com.gs.collections.api.LazyIntIterable |
asLazy() |
com.gs.collections.api.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. |
<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) |
com.gs.collections.api.list.primitive.ImmutableIntList |
distinct() |
long |
dotProduct(com.gs.collections.api.list.primitive.IntList list) |
void |
each(com.gs.collections.api.block.procedure.primitive.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 |
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() |
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() |
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) |
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() |
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() |
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() |
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.
|
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()
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 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.OrderedIntIterablepublic void forEach(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure)
forEach in interface com.gs.collections.api.IntIterablepublic void each(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure)
each 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(Object otherList)
public int hashCode()
public 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 distinct()
distinct in interface com.gs.collections.api.list.primitive.ImmutableIntListdistinct in interface com.gs.collections.api.list.primitive.IntListdistinct 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.IntListpublic 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()
isEmpty in interface com.gs.collections.api.PrimitiveIterablepublic boolean notEmpty()
notEmpty in interface com.gs.collections.api.PrimitiveIterablepublic String makeString()
makeString in interface com.gs.collections.api.PrimitiveIterablepublic String makeString(String separator)
makeString in interface com.gs.collections.api.PrimitiveIterablepublic String makeString(String start, String separator, String end)
makeString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(Appendable appendable)
appendString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
appendString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
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.OrderedIntIterableinjectIntoWithIndex in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic String toString()
public 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.OrderedIntIterablepublic 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.OrderedIntIterablepublic 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.OrderedIntIterableselect 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.OrderedIntIterablereject 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.OrderedIntIterablecollect 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 binarySearch(int value)
binarySearch in interface com.gs.collections.api.list.primitive.IntListpublic 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()
toImmutable 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.ImmutableIntListCopyright © 2004–2016. All rights reserved.