@NotThreadSafe public final class IntArrayList extends Object implements MutableIntList, 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(IntIterable source) |
boolean |
addAllAtIndex(int index,
int... source) |
boolean |
addAllAtIndex(int index,
IntIterable source) |
void |
addAtIndex(int index,
int element) |
boolean |
allSatisfy(IntPredicate predicate) |
boolean |
anySatisfy(IntPredicate predicate) |
void |
appendString(Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
LazyIntIterable |
asLazy() |
LazyIntIterable |
asReversed() |
MutableIntList |
asSynchronized() |
MutableIntList |
asUnmodifiable() |
double |
average() |
void |
clear() |
<V> MutableList<V> |
collect(IntToObjectFunction<? extends V> function) |
boolean |
contains(int value) |
boolean |
containsAll(int... source) |
boolean |
containsAll(IntIterable source) |
int |
count(IntPredicate predicate) |
int |
detectIfNone(IntPredicate predicate,
int ifNone) |
long |
dotProduct(IntList list) |
void |
ensureCapacity(int minCapacity) |
boolean |
equals(Object otherList)
Follows the same general contract as
List.equals(Object). |
void |
forEach(IntProcedure procedure) |
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) |
IntIterator |
intIterator() |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
int |
lastIndexOf(int value) |
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). |
String |
makeString(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). |
String |
makeString(String start,
String separator,
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(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) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
void |
readExternal(ObjectInput in) |
IntArrayList |
reject(IntPredicate predicate) |
boolean |
remove(int value) |
boolean |
removeAll(int... source) |
boolean |
removeAll(IntIterable source) |
int |
removeAtIndex(int index) |
boolean |
retainAll(int... source) |
boolean |
retainAll(IntIterable source) |
IntArrayList |
reverseThis() |
IntArrayList |
select(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).
|
MutableIntList |
subList(int fromIndex,
int toIndex) |
long |
sum() |
int[] |
toArray() |
MutableIntBag |
toBag() |
ImmutableIntList |
toImmutable()
Returns an immutable copy of this list.
|
MutableIntList |
toList() |
IntArrayList |
toReversed() |
MutableIntSet |
toSet() |
int[] |
toSortedArray() |
MutableIntList |
toSortedList() |
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(IntIterable elements) |
IntArrayList |
without(int element) |
IntArrayList |
withoutAll(IntIterable elements) |
void |
writeExternal(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(IntIterable source)
public static IntArrayList newWithNValues(int size, int value)
public int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic void clear()
clear in interface MutableIntCollectionpublic boolean contains(int value)
contains in interface IntIterablepublic boolean containsAll(int... source)
containsAll in interface IntIterablepublic boolean containsAll(IntIterable source)
containsAll in interface IntIterablepublic int getFirst()
getFirst in interface ReversibleIntIterablepublic int getLast()
getLast in interface ReversibleIntIterablepublic int indexOf(int value)
indexOf in interface ReversibleIntIterablepublic 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 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 IntIterator intIterator()
intIterator in interface IntIterablepublic void forEach(IntProcedure procedure)
forEach in interface IntIterablepublic void forEachWithIndex(IntIntProcedure procedure)
forEachWithIndex in interface ReversibleIntIterablepublic <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 ReversibleIntIterablepublic int count(IntPredicate predicate)
count in interface IntIterablepublic boolean anySatisfy(IntPredicate predicate)
anySatisfy in interface IntIterablepublic boolean allSatisfy(IntPredicate predicate)
allSatisfy in interface IntIterablepublic boolean noneSatisfy(IntPredicate predicate)
noneSatisfy in interface IntIterablepublic IntArrayList select(IntPredicate predicate)
select in interface MutableIntCollectionselect in interface IntIterableselect in interface IntListselect in interface MutableIntListselect in interface ReversibleIntIterablepublic IntArrayList reject(IntPredicate predicate)
reject in interface MutableIntCollectionreject in interface IntIterablereject in interface IntListreject in interface MutableIntListreject in interface ReversibleIntIterablepublic int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone in interface IntIterablepublic <V> MutableList<V> collect(IntToObjectFunction<? extends V> function)
collect in interface MutableIntCollectioncollect in interface IntIterablecollect in interface IntListcollect in interface MutableIntListcollect in interface ReversibleIntIterablepublic int max()
max in interface IntIterablepublic int min()
min in interface IntIterablepublic int minIfEmpty(int defaultValue)
minIfEmpty in interface IntIterablepublic int maxIfEmpty(int defaultValue)
maxIfEmpty in interface IntIterablepublic long sum()
sum in interface IntIterablepublic long dotProduct(IntList list)
dotProduct in interface IntListpublic double average()
average in interface IntIterablepublic double median()
median in interface IntIterablepublic int[] toArray()
toArray in interface IntIterablepublic int[] toSortedArray()
toSortedArray in interface IntIterablepublic boolean equals(Object otherList)
IntListList.equals(Object).public int hashCode()
IntListList.hashCode().public String toString()
PrimitiveIterabletoString in interface PrimitiveIterabletoString in class Objectpublic String makeString()
PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface PrimitiveIterablepublic String makeString(String separator)
PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
PrimitiveIterablemakeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface PrimitiveIterablepublic 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 toList()
toList in interface IntIterablepublic MutableIntList toSortedList()
toSortedList in interface IntIterablepublic MutableIntSet toSet()
toSet in interface IntIterablepublic MutableIntBag toBag()
toBag in interface IntIterablepublic LazyIntIterable asLazy()
asLazy in interface IntIterablepublic MutableIntList asUnmodifiable()
asUnmodifiable in interface MutableIntCollectionasUnmodifiable in interface MutableIntListpublic MutableIntList asSynchronized()
asSynchronized in interface MutableIntCollectionasSynchronized in interface MutableIntListpublic ImmutableIntList toImmutable()
MutableIntListtoImmutable in interface MutableIntCollectiontoImmutable in interface IntListtoImmutable 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 MutableIntList subList(int fromIndex, int toIndex)
subList in interface IntListsubList in interface MutableIntListList#subList(int fromIndex, int toIndex)}Copyright © 2004–2017. All rights reserved.