@NotThreadSafe
public final class IntArrayList
extends java.lang.Object
implements com.gs.collections.api.list.primitive.MutableIntList, java.io.Externalizable
FastList, and is memory-optimized for int primitives.
This file was automatically generated from template file primitiveArrayList.stg.| Constructor and Description |
|---|
IntArrayList() |
IntArrayList(int... array) |
IntArrayList(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int newItem) |
boolean |
addAll(int... source) |
boolean |
addAll(com.gs.collections.api.IntIterable source) |
boolean |
addAllAtIndex(int index,
int... source) |
boolean |
addAllAtIndex(int index,
com.gs.collections.api.IntIterable source) |
void |
addAtIndex(int index,
int element) |
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.IntIterable |
asReversed() |
com.gs.collections.api.list.primitive.MutableIntList |
asSynchronized() |
com.gs.collections.api.list.primitive.MutableIntList |
asUnmodifiable() |
double |
average() |
void |
clear() |
<V> com.gs.collections.api.list.MutableList<V> |
collect(com.gs.collections.api.block.function.primitive.IntToObjectFunction<? extends V> function) |
boolean |
contains(int value) |
boolean |
containsAll(int... source) |
boolean |
containsAll(com.gs.collections.api.IntIterable source) |
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) |
void |
ensureCapacity(int minCapacity) |
boolean |
equals(java.lang.Object otherList)
Follows the same general contract as
List.equals(Object). |
void |
forEach(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure) |
void |
forEachWithIndex(com.gs.collections.api.block.procedure.primitive.IntIntProcedure procedure) |
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) |
static IntArrayList |
newList(com.gs.collections.api.IntIterable source) |
static IntArrayList |
newListWith(int... elements)
Creates a new list using the passed
elements argument as the backing store. |
static IntArrayList |
newWithNValues(int size,
int value) |
boolean |
noneSatisfy(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
void |
readExternal(java.io.ObjectInput in) |
IntArrayList |
reject(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
boolean |
remove(int value) |
boolean |
removeAll(int... source) |
boolean |
removeAll(com.gs.collections.api.IntIterable source) |
int |
removeAtIndex(int index) |
IntArrayList |
reverseThis() |
IntArrayList |
select(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate) |
int |
set(int index,
int element) |
int |
size()
Returns the number of items in this iterable.
|
IntArrayList |
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).
|
long |
sum() |
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() |
IntArrayList |
toReversed() |
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.
|
void |
trimToSize() |
IntArrayList |
with(int element) |
IntArrayList |
with(int element1,
int element2) |
IntArrayList |
with(int element1,
int element2,
int element3) |
IntArrayList |
with(int element1,
int element2,
int element3,
int... elements) |
IntArrayList |
withAll(com.gs.collections.api.IntIterable elements) |
IntArrayList |
without(int element) |
IntArrayList |
withoutAll(com.gs.collections.api.IntIterable elements) |
void |
writeExternal(java.io.ObjectOutput out) |
public IntArrayList()
public IntArrayList(int initialCapacity)
public IntArrayList(int... array)
public static IntArrayList newListWith(int... elements)
elements argument as the backing store.
!!! WARNING: This method uses the passed in array, so can be very unsafe if the original
array is held onto anywhere else. !!!public static IntArrayList newList(com.gs.collections.api.IntIterable source)
public static IntArrayList newWithNValues(int size, int value)
public int size()
com.gs.collections.api.PrimitiveIterablesize in interface com.gs.collections.api.PrimitiveIterablepublic 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 void clear()
clear in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic boolean contains(int value)
contains in interface com.gs.collections.api.IntIterablepublic boolean containsAll(int... source)
containsAll in interface com.gs.collections.api.IntIterablepublic boolean containsAll(com.gs.collections.api.IntIterable source)
containsAll in interface com.gs.collections.api.IntIterablepublic int get(int index)
get in interface com.gs.collections.api.list.primitive.IntListpublic int getFirst()
getFirst in interface com.gs.collections.api.list.primitive.IntListpublic int getLast()
getLast in interface com.gs.collections.api.list.primitive.IntListpublic int indexOf(int value)
indexOf in interface com.gs.collections.api.list.primitive.IntListpublic int lastIndexOf(int value)
lastIndexOf in interface com.gs.collections.api.list.primitive.IntListpublic void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(int newItem)
add in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic boolean addAll(int... source)
addAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic boolean addAll(com.gs.collections.api.IntIterable source)
addAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic void addAtIndex(int index,
int element)
addAtIndex in interface com.gs.collections.api.list.primitive.MutableIntListpublic boolean addAllAtIndex(int index,
int... source)
addAllAtIndex in interface com.gs.collections.api.list.primitive.MutableIntListpublic boolean addAllAtIndex(int index,
com.gs.collections.api.IntIterable source)
addAllAtIndex in interface com.gs.collections.api.list.primitive.MutableIntListpublic boolean remove(int value)
remove in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic boolean removeAll(com.gs.collections.api.IntIterable source)
removeAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic boolean removeAll(int... source)
removeAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic int removeAtIndex(int index)
removeAtIndex in interface com.gs.collections.api.list.primitive.MutableIntListpublic int set(int index,
int element)
set in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList with(int element)
with in interface com.gs.collections.api.collection.primitive.MutableIntCollectionwith in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList without(int element)
without in interface com.gs.collections.api.collection.primitive.MutableIntCollectionwithout in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList withAll(com.gs.collections.api.IntIterable elements)
withAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionwithAll in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList withoutAll(com.gs.collections.api.IntIterable elements)
withoutAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionwithoutAll in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList with(int element1, int element2)
public IntArrayList with(int element1, int element2, int element3)
public IntArrayList with(int element1, int element2, int element3, int... elements)
public com.gs.collections.api.iterator.IntIterator intIterator()
intIterator in interface com.gs.collections.api.IntIterablepublic void forEach(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure)
forEach in interface com.gs.collections.api.IntIterablepublic void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.IntIntProcedure procedure)
public <T> T injectInto(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectIntToObjectFunction<? super T,? extends T> function)
public <T> T injectIntoWithIndex(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectIntIntToObjectFunction<? super T,? extends T> function)
public 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 IntArrayList select(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
select in interface com.gs.collections.api.collection.primitive.MutableIntCollectionselect in interface com.gs.collections.api.IntIterableselect in interface com.gs.collections.api.list.primitive.IntListselect in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList reject(com.gs.collections.api.block.predicate.primitive.IntPredicate predicate)
reject in interface com.gs.collections.api.collection.primitive.MutableIntCollectionreject in interface com.gs.collections.api.IntIterablereject in interface com.gs.collections.api.list.primitive.IntListreject in interface com.gs.collections.api.list.primitive.MutableIntListpublic 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.MutableList<V> collect(com.gs.collections.api.block.function.primitive.IntToObjectFunction<? extends V> function)
collect in interface com.gs.collections.api.collection.primitive.MutableIntCollectioncollect in interface com.gs.collections.api.IntIterablecollect in interface com.gs.collections.api.list.primitive.IntListcollect in interface com.gs.collections.api.list.primitive.MutableIntListpublic 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 long sum()
sum in interface com.gs.collections.api.IntIterablepublic long dotProduct(com.gs.collections.api.list.primitive.IntList list)
dotProduct in interface com.gs.collections.api.list.primitive.IntListpublic double average()
average in interface com.gs.collections.api.IntIterablepublic double median()
median in interface com.gs.collections.api.IntIterablepublic int[] toArray()
toArray in interface com.gs.collections.api.IntIterablepublic int[] toSortedArray()
toSortedArray 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 java.lang.String toString()
com.gs.collections.api.PrimitiveIterabletoString in interface com.gs.collections.api.PrimitiveIterabletoString in class java.lang.Objectpublic 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 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.MutableIntList asUnmodifiable()
asUnmodifiable in interface com.gs.collections.api.collection.primitive.MutableIntCollectionasUnmodifiable in interface com.gs.collections.api.list.primitive.MutableIntListpublic com.gs.collections.api.list.primitive.MutableIntList asSynchronized()
asSynchronized in interface com.gs.collections.api.collection.primitive.MutableIntCollectionasSynchronized in interface com.gs.collections.api.list.primitive.MutableIntListpublic com.gs.collections.api.list.primitive.ImmutableIntList toImmutable()
com.gs.collections.api.list.primitive.MutableIntListtoImmutable in interface com.gs.collections.api.collection.primitive.MutableIntCollectiontoImmutable in interface com.gs.collections.api.list.primitive.IntListtoImmutable in interface com.gs.collections.api.list.primitive.MutableIntListpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal in interface java.io.Externalizablejava.io.IOExceptionpublic com.gs.collections.api.IntIterable asReversed()
public IntArrayList reverseThis()
reverseThis in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList sortThis()
com.gs.collections.api.list.primitive.MutableIntListsortThis in interface com.gs.collections.api.list.primitive.MutableIntListpublic IntArrayList toReversed()
toReversed in interface com.gs.collections.api.list.primitive.MutableIntList