Externalizable
, Serializable
, MutableIntCollection
, IntIterable
, IntList
, MutableIntList
, OrderedIntIterable
, ReversibleIntIterable
, PrimitiveIterable
public 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, toString
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList
primitiveParallelStream, primitiveStream
collectWithIndex, tap
collectWithIndex
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
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()
PrimitiveIterable
size
in interface PrimitiveIterable
public void clear()
clear
in interface MutableIntCollection
public boolean contains(int value)
IntIterable
contains
in interface IntIterable
public int getFirst()
getFirst
in interface OrderedIntIterable
public int getLast()
getLast
in interface ReversibleIntIterable
public int indexOf(int value)
indexOf
in interface OrderedIntIterable
public int lastIndexOf(int value)
lastIndexOf
in interface IntList
public void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(int newItem)
add
in interface MutableIntCollection
public boolean addAll(int... source)
addAll
in interface MutableIntCollection
public boolean addAll(IntIterable source)
addAll
in interface MutableIntCollection
public void addAtIndex(int index, int element)
addAtIndex
in interface MutableIntList
public boolean addAllAtIndex(int index, int... source)
addAllAtIndex
in interface MutableIntList
public boolean addAllAtIndex(int index, IntIterable source)
addAllAtIndex
in interface MutableIntList
public boolean remove(int value)
remove
in interface MutableIntCollection
public boolean removeIf(IntPredicate predicate)
removeIf
in interface MutableIntCollection
public boolean removeAll(IntIterable source)
removeAll
in interface MutableIntCollection
public boolean removeAll(int... source)
removeAll
in interface MutableIntCollection
public boolean retainAll(IntIterable source)
retainAll
in interface MutableIntCollection
Collection.retainAll(Collection)
public boolean retainAll(int... source)
retainAll
in interface MutableIntCollection
Collection.retainAll(Collection)
public int removeAtIndex(int index)
removeAtIndex
in interface MutableIntList
public int set(int index, int element)
set
in interface MutableIntList
public IntArrayList with(int element)
with
in interface MutableIntCollection
with
in interface MutableIntList
public IntArrayList without(int element)
without
in interface MutableIntCollection
without
in interface MutableIntList
public IntArrayList withAll(IntIterable elements)
withAll
in interface MutableIntCollection
withAll
in interface MutableIntList
public IntArrayList withoutAll(IntIterable elements)
withoutAll
in interface MutableIntCollection
withoutAll
in interface MutableIntList
public 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()
IntIterable
intIterator
in interface IntIterable
intIterator
in interface MutableIntCollection
public void forEach(IntProcedure procedure)
IntIterable
forEach
in interface IntIterable
public void each(IntProcedure procedure)
IntIterable
each
in interface IntIterable
public void forEachWithIndex(IntIntProcedure procedure)
forEachWithIndex
in interface OrderedIntIterable
public <T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)
injectInto
in interface IntIterable
public <T> T injectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex
in interface OrderedIntIterable
injectIntoWithIndex
in interface ReversibleIntIterable
public RichIterable<IntIterable> chunk(int size)
IntIterable
chunk
in interface IntIterable
size
- the number of elements per chunkRichIterable
containing IntIterable
s of size size
, except the last will be
truncated if the elements don't divide evenly.public int count(IntPredicate predicate)
IntIterable
count
in interface IntIterable
public boolean anySatisfy(IntPredicate predicate)
IntIterable
anySatisfy
in interface IntIterable
public boolean allSatisfy(IntPredicate predicate)
IntIterable
allSatisfy
in interface IntIterable
public boolean noneSatisfy(IntPredicate predicate)
IntIterable
noneSatisfy
in interface IntIterable
public IntArrayList select(IntPredicate predicate)
IntIterable
select
in interface IntIterable
select
in interface IntList
select
in interface MutableIntCollection
select
in interface MutableIntList
select
in interface OrderedIntIterable
select
in interface ReversibleIntIterable
public <R extends MutableIntCollection> R select(IntPredicate predicate, R target)
IntIterable
IntIterable.select(IntPredicate)
, only the results are added to the target MutableIntCollection.select
in interface IntIterable
public IntArrayList reject(IntPredicate predicate)
IntIterable
reject
in interface IntIterable
reject
in interface IntList
reject
in interface MutableIntCollection
reject
in interface MutableIntList
reject
in interface OrderedIntIterable
reject
in interface ReversibleIntIterable
public <R extends MutableIntCollection> R reject(IntPredicate predicate, R target)
IntIterable
IntIterable.reject(IntPredicate)
, only the results are added to the target MutableIntCollection.reject
in interface IntIterable
public int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone
in interface IntIterable
public <V> MutableList<V> collect(IntToObjectFunction<? extends V> function)
IntIterable
collect
in interface IntIterable
collect
in interface IntList
collect
in interface MutableIntCollection
collect
in interface MutableIntList
collect
in interface OrderedIntIterable
collect
in interface ReversibleIntIterable
public <V,R extends Collection<V>> R collect(IntToObjectFunction<? extends V> function, R target)
IntIterable
IntIterable.collect(IntToObjectFunction)
, only the results are added to the target Collection.collect
in interface IntIterable
public int max()
max
in interface IntIterable
public int min()
min
in interface IntIterable
public long sum()
sum
in interface IntIterable
public long dotProduct(IntList list)
dotProduct
in interface IntList
public int[] toArray()
IntIterable
toArray
in interface IntIterable
public boolean equals(Object otherList)
IntList
List.equals(Object)
.public int hashCode()
IntList
List.hashCode()
.public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public MutableIntList asUnmodifiable()
asUnmodifiable
in interface MutableIntCollection
asUnmodifiable
in interface MutableIntList
public MutableIntList asSynchronized()
asSynchronized
in interface MutableIntCollection
asSynchronized
in interface MutableIntList
public ImmutableIntList toImmutable()
MutableIntList
toImmutable
in interface IntList
toImmutable
in interface MutableIntCollection
toImmutable
in interface MutableIntList
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
public LazyIntIterable asReversed()
asReversed
in interface ReversibleIntIterable
public IntArrayList reverseThis()
reverseThis
in interface MutableIntList
public IntArrayList sortThis()
MutableIntList
sortThis
in interface MutableIntList
public IntArrayList toReversed()
toReversed
in interface IntList
toReversed
in interface MutableIntList
toReversed
in interface ReversibleIntIterable
public int binarySearch(int value)
binarySearch
in interface IntList
public MutableIntList distinct()
distinct
in interface IntList
distinct
in interface MutableIntList
distinct
in interface ReversibleIntIterable
public MutableIntList subList(int fromIndex, int toIndex)
subList
in interface IntList
subList
in interface MutableIntList
List.subList(int fromIndex, int toIndex)
public MutableList<IntIntPair> zipInt(IntIterable iterable)
MutableIntList
MutableList
formed from this MutableIntList
and another IntList
by
combining corresponding elements in pairs. If one of the two IntList
s is longer than the other, its
remaining elements are ignored.zipInt
in interface IntList
zipInt
in interface MutableIntList
public IntArrayList newEmpty()
newEmpty
in interface MutableIntCollection
newEmpty
in interface MutableIntList
public <T> MutableList<IntObjectPair<T>> zip(Iterable<T> iterable)
MutableIntList
MutableList
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 IntList
zip
in interface MutableIntList
public Spliterator.OfInt spliterator()
spliterator
in interface IntList
Copyright © 2004–2019. All rights reserved.