@NotThreadSafe public class IntArrayList extends AbstractIntIterable 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.| Modifier and Type | Field and Description |
|---|---|
protected int[] |
items |
protected int |
size |
| 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,
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 |
asReversed() |
com.gs.collections.api.list.primitive.MutableIntList |
asSynchronized() |
com.gs.collections.api.list.primitive.MutableIntList |
asUnmodifiable() |
int |
binarySearch(int value) |
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) |
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.MutableIntList |
distinct() |
long |
dotProduct(com.gs.collections.api.list.primitive.IntList list) |
void |
each(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure) |
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.MutableIntIterator |
intIterator() |
int |
lastIndexOf(int value) |
int |
max() |
int |
min() |
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) |
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) |
boolean |
retainAll(int... source) |
boolean |
retainAll(com.gs.collections.api.IntIterable source) |
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).
|
com.gs.collections.api.list.primitive.MutableIntList |
subList(int fromIndex,
int toIndex) |
long |
sum() |
int[] |
toArray() |
com.gs.collections.api.list.primitive.ImmutableIntList |
toImmutable()
Returns an immutable copy of this list.
|
IntArrayList |
toReversed() |
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) |
appendString, appendString, asLazy, average, containsAll, containsAll, isEmpty, makeString, makeString, makeString, maxIfEmpty, median, minIfEmpty, notEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic 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 void clear()
clear in interface com.gs.collections.api.collection.primitive.MutableIntCollectionpublic boolean contains(int value)
contains 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.ordered.primitive.OrderedIntIterablepublic int getLast()
getLast in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic 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 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 boolean retainAll(com.gs.collections.api.IntIterable source)
retainAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionCollection.retainAll(Collection)public boolean retainAll(int... source)
retainAll in interface com.gs.collections.api.collection.primitive.MutableIntCollectionCollection.retainAll(Collection)public 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.MutableIntIterator intIterator()
intIterator in interface com.gs.collections.api.collection.primitive.MutableIntCollectionintIterator 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 each(com.gs.collections.api.block.procedure.primitive.IntProcedure procedure)
each 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 <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 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.MutableIntListselect in interface com.gs.collections.api.ordered.primitive.OrderedIntIterableselect in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic 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.MutableIntListreject 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.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.MutableIntListcollect in interface com.gs.collections.api.ordered.primitive.OrderedIntIterablecollect in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic int max()
max in interface com.gs.collections.api.IntIterablepublic int min()
min 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 int[] toArray()
toArray 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 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 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.LazyIntIterable asReversed()
asReversed in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic 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.IntListtoReversed in interface com.gs.collections.api.list.primitive.MutableIntListtoReversed in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic int binarySearch(int value)
binarySearch in interface com.gs.collections.api.list.primitive.IntListpublic com.gs.collections.api.list.primitive.MutableIntList distinct()
distinct in interface com.gs.collections.api.list.primitive.IntListdistinct in interface com.gs.collections.api.list.primitive.MutableIntListdistinct in interface com.gs.collections.api.ordered.primitive.ReversibleIntIterablepublic com.gs.collections.api.list.primitive.MutableIntList subList(int fromIndex,
int toIndex)
subList in interface com.gs.collections.api.list.primitive.IntListsubList in interface com.gs.collections.api.list.primitive.MutableIntListList#subList(int fromIndex, int toIndex)}