Externalizable, Serializable, MutableIntCollection, IntIterable, IntList, MutableIntList, OrderedIntIterable, ReversibleIntIterable, PrimitiveIterablepublic class IntArrayList extends AbstractIntIterable implements MutableIntList, Externalizable
FastList, and is memory-optimized for int primitives.
This file was automatically generated from template file primitiveArrayList.stg.| Constructor | Description |
|---|---|
IntArrayList() |
|
IntArrayList(int initialCapacity) |
|
IntArrayList(int... array) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(int newItem) |
|
boolean |
addAll(int... source) |
|
boolean |
addAll(IntIterable source) |
|
boolean |
addAllAtIndex(int index,
int... source) |
|
boolean |
addAllAtIndex(int index,
IntIterable source) |
|
void |
addAtIndex(int index,
int element) |
|
boolean |
allSatisfy(IntPredicate predicate) |
Returns true if all of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(IntPredicate predicate) |
Returns true if any of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable. |
LazyIntIterable |
asReversed() |
|
MutableIntList |
asSynchronized() |
|
MutableIntList |
asUnmodifiable() |
|
int |
binarySearch(int value) |
|
RichIterable<IntIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<V> MutableList<V> |
collect(IntToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
<V,R extends Collection<V>> |
collect(IntToObjectFunction<? extends V> function,
R target) |
Same as
IntIterable.collect(IntToObjectFunction) , only the results are added to the target Collection. |
boolean |
contains(int value) |
Returns true if the value is contained in the IntIterable, and false if it is not.
|
int |
count(IntPredicate predicate) |
Returns a count of the number of elements in the IntIterable that return true for the
specified predicate.
|
int |
detectIfNone(IntPredicate predicate,
int ifNone) |
|
MutableIntList |
distinct() |
|
long |
dotProduct(IntList list) |
|
void |
each(IntProcedure procedure) |
A synonym for forEach.
|
void |
ensureCapacity(int minCapacity) |
|
boolean |
equals(Object otherList) |
Follows the same general contract as
List.equals(Object). |
void |
forEach(IntProcedure procedure) |
Applies the IntProcedure to each element in the IntIterable.
|
void |
forEachWithIndex(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,
ObjectIntToObjectFunction<? super T,? extends T> function) |
|
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectIntIntToObjectFunction<? super T,? extends T> function) |
|
MutableIntIterator |
intIterator() |
Returns a primitive iterator that can be used to iterate over the IntIterable in an
imperative style.
|
int |
lastIndexOf(int value) |
|
int |
max() |
|
int |
min() |
|
IntArrayList |
newEmpty() |
Creates a new empty IntArrayList.
|
static IntArrayList |
newList(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(IntPredicate predicate) |
Returns true if none of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(ObjectInput in) |
|
IntArrayList |
reject(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return false for the specified predicate.
|
<R extends MutableIntCollection> |
reject(IntPredicate predicate,
R target) |
Same as
IntIterable.reject(IntPredicate) , only the results are added to the target MutableIntCollection. |
boolean |
remove(int value) |
|
boolean |
removeAll(int... source) |
|
boolean |
removeAll(IntIterable source) |
|
int |
removeAtIndex(int index) |
|
boolean |
removeIf(IntPredicate predicate) |
|
boolean |
retainAll(int... source) |
|
boolean |
retainAll(IntIterable source) |
|
IntArrayList |
reverseThis() |
|
IntArrayList |
select(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return true for the specified predicate.
|
<R extends MutableIntCollection> |
select(IntPredicate predicate,
R target) |
Same as
IntIterable.select(IntPredicate) , only the results are added to the target MutableIntCollection. |
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).
|
Spliterator.OfInt |
spliterator() |
|
MutableIntList |
subList(int fromIndex,
int toIndex) |
|
long |
sum() |
|
int[] |
toArray() |
Converts the IntIterable to a primitive int array.
|
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(IntIterable elements) |
|
IntArrayList |
without(int element) |
|
IntArrayList |
withoutAll(IntIterable elements) |
|
void |
writeExternal(ObjectOutput out) |
|
<T> MutableList<IntObjectPair<T>> |
zip(Iterable<T> iterable) |
Returns a
MutableList formed from this MutableIntList and a ListIterable by
combining corresponding elements in pairs. |
MutableList<IntIntPair> |
zipInt(IntIterable iterable) |
Returns a
MutableList formed from this MutableIntList and another IntList by
combining corresponding elements in pairs. |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringasLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedListprimitiveParallelStream, primitiveStreamcollectWithIndex, tapcollectWithIndexappendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toStringpublic 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(IntIterable source)
public static IntArrayList newWithNValues(int size, int value)
public int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic void clear()
clear in interface MutableIntCollectionpublic boolean contains(int value)
IntIterablecontains 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 void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(int newItem)
add in interface MutableIntCollectionpublic boolean addAll(int... source)
addAll in interface MutableIntCollectionpublic boolean addAll(IntIterable source)
addAll in interface MutableIntCollectionpublic void addAtIndex(int index,
int element)
addAtIndex in interface MutableIntListpublic boolean addAllAtIndex(int index,
int... source)
addAllAtIndex in interface MutableIntListpublic boolean addAllAtIndex(int index,
IntIterable source)
addAllAtIndex in interface MutableIntListpublic boolean remove(int value)
remove in interface MutableIntCollectionpublic boolean removeIf(IntPredicate predicate)
removeIf in interface MutableIntCollectionpublic boolean removeAll(IntIterable source)
removeAll in interface MutableIntCollectionpublic boolean removeAll(int... source)
removeAll in interface MutableIntCollectionpublic boolean retainAll(IntIterable source)
retainAll in interface MutableIntCollectionCollection.retainAll(Collection)public boolean retainAll(int... source)
retainAll in interface MutableIntCollectionCollection.retainAll(Collection)public int removeAtIndex(int index)
removeAtIndex in interface MutableIntListpublic int set(int index,
int element)
set in interface MutableIntListpublic IntArrayList with(int element)
with in interface MutableIntCollectionwith in interface MutableIntListpublic IntArrayList without(int element)
without in interface MutableIntCollectionwithout in interface MutableIntListpublic IntArrayList withAll(IntIterable elements)
withAll in interface MutableIntCollectionwithAll in interface MutableIntListpublic IntArrayList withoutAll(IntIterable elements)
withoutAll in interface MutableIntCollectionwithoutAll in interface 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 MutableIntIterator intIterator()
IntIterableintIterator in interface IntIterableintIterator in interface MutableIntCollectionpublic void forEach(IntProcedure procedure)
IntIterableforEach in interface IntIterablepublic void each(IntProcedure procedure)
IntIterableeach in interface IntIterablepublic void forEachWithIndex(IntIntProcedure procedure)
forEachWithIndex in interface OrderedIntIterablepublic <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)
IntIterablechunk in interface IntIterablesize - the number of elements per chunkRichIterable containing IntIterables of size size, except the last will be
truncated if the elements don't divide evenly.public int count(IntPredicate predicate)
IntIterablecount in interface IntIterablepublic boolean anySatisfy(IntPredicate predicate)
IntIterableanySatisfy in interface IntIterablepublic boolean allSatisfy(IntPredicate predicate)
IntIterableallSatisfy in interface IntIterablepublic boolean noneSatisfy(IntPredicate predicate)
IntIterablenoneSatisfy in interface IntIterablepublic IntArrayList select(IntPredicate predicate)
IntIterableselect in interface IntIterableselect in interface IntListselect in interface MutableIntCollectionselect in interface MutableIntListselect in interface OrderedIntIterableselect in interface ReversibleIntIterablepublic <R extends MutableIntCollection> R select(IntPredicate predicate, R target)
IntIterableIntIterable.select(IntPredicate) , only the results are added to the target MutableIntCollection.select in interface IntIterablepublic IntArrayList reject(IntPredicate predicate)
IntIterablereject in interface IntIterablereject in interface IntListreject in interface MutableIntCollectionreject in interface MutableIntListreject in interface OrderedIntIterablereject in interface ReversibleIntIterablepublic <R extends MutableIntCollection> R reject(IntPredicate predicate, R target)
IntIterableIntIterable.reject(IntPredicate) , only the results are added to the target MutableIntCollection.reject in interface IntIterablepublic int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone in interface IntIterablepublic <V> MutableList<V> collect(IntToObjectFunction<? extends V> function)
IntIterablecollect in interface IntIterablecollect in interface IntListcollect in interface MutableIntCollectioncollect in interface MutableIntListcollect in interface OrderedIntIterablecollect in interface ReversibleIntIterablepublic <V,R extends Collection<V>> R collect(IntToObjectFunction<? extends V> function, R target)
IntIterableIntIterable.collect(IntToObjectFunction) , only the results are added to the target Collection.collect in interface IntIterablepublic int max()
max in interface IntIterablepublic int min()
min in interface IntIterablepublic long sum()
sum in interface IntIterablepublic long dotProduct(IntList list)
dotProduct in interface IntListpublic int[] toArray()
IntIterabletoArray in interface IntIterablepublic boolean equals(Object otherList)
IntListList.equals(Object).public int hashCode()
IntListList.hashCode().public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic MutableIntList asUnmodifiable()
asUnmodifiable in interface MutableIntCollectionasUnmodifiable in interface MutableIntListpublic MutableIntList asSynchronized()
asSynchronized in interface MutableIntCollectionasSynchronized in interface MutableIntListpublic ImmutableIntList toImmutable()
MutableIntListtoImmutable in interface IntListtoImmutable in interface MutableIntCollectiontoImmutable in interface MutableIntListpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic LazyIntIterable asReversed()
asReversed in interface ReversibleIntIterablepublic IntArrayList reverseThis()
reverseThis in interface MutableIntListpublic IntArrayList sortThis()
MutableIntListsortThis in interface MutableIntListpublic IntArrayList toReversed()
toReversed in interface IntListtoReversed in interface MutableIntListtoReversed in interface ReversibleIntIterablepublic int binarySearch(int value)
binarySearch in interface IntListpublic MutableIntList distinct()
distinct in interface IntListdistinct in interface MutableIntListdistinct in interface ReversibleIntIterablepublic MutableIntList subList(int fromIndex, int toIndex)
subList in interface IntListsubList in interface MutableIntListList.subList(int fromIndex, int toIndex)public MutableList<IntIntPair> zipInt(IntIterable iterable)
MutableIntListMutableList formed from this MutableIntList and another IntList by
combining corresponding elements in pairs. If one of the two IntLists is longer than the other, its
remaining elements are ignored.zipInt in interface IntListzipInt in interface MutableIntListpublic IntArrayList newEmpty()
newEmpty in interface MutableIntCollectionnewEmpty in interface MutableIntListpublic <T> MutableList<IntObjectPair<T>> zip(Iterable<T> iterable)
MutableIntListMutableList formed from this MutableIntList and a ListIterable by
combining corresponding elements in pairs. If one of the two Lists is longer than the other, its
remaining elements are ignored.zip in interface IntListzip in interface MutableIntListpublic Spliterator.OfInt spliterator()
spliterator in interface IntListCopyright © 2004–2019. All rights reserved.