public class ArrayIntList extends IntList.Base implements IntList, java.util.RandomAccess
IntList.Base| Constructor and Description |
|---|
ArrayIntList()
Create a new mutable
ArrayIntList. |
ArrayIntList(int capacity)
Deprecated.
Use
withCapacity(int) instead. |
ArrayIntList(int[] xs) |
ArrayIntList(IntCollection xs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAllInts(int... xs) |
boolean |
addAllInts(IntCollection xs) |
boolean |
addAllIntsAt(int index,
int... xs) |
boolean |
addAllIntsAt(int index,
IntCollection xs) |
boolean |
addInt(int x) |
void |
addIntAt(int index,
int x) |
int |
binarySearch(int x) |
void |
clear() |
boolean |
containsAllInts(int... xs) |
boolean |
containsInt(int x) |
static ArrayIntList |
create()
Create a new empty mutable
ArrayIntList. |
static ArrayIntList |
create(int... xs)
Create a new mutable
ArrayIntList initialized with a copy of the given contents. |
void |
forEachInt(java.util.function.IntConsumer consumer)
Performs the given action for each
int in this iterable. |
int |
getInt(int index) |
int |
indexOfInt(int x) |
boolean |
isEmpty() |
IntIterator |
iterator() |
int |
lastIndexOfInt(int x) |
IntListIterator |
listIterator(int index) |
static ArrayIntList |
of(int... xs)
Deprecated.
Use
create(int...) instead. |
boolean |
removeAllInts(int... xs) |
boolean |
removeInt(int x) |
int |
removeIntAt(int index) |
boolean |
removeIntsIf(java.util.function.IntPredicate filter) |
void |
replaceAllInts(java.util.function.IntUnaryOperator operator) |
boolean |
retainAllInts(int... xs) |
int |
setInt(int index,
int x) |
int |
size() |
void |
sortInts() |
java.util.Spliterator.OfInt |
spliterator() |
IntList |
subList(int from,
int to) |
int[] |
toIntArray()
Collect the
ints in this IntCollection into an int-array. |
protected void |
uncheckedAdd(int index,
IntIterable xs,
int xsSize) |
static ArrayIntList |
withCapacity(int capacity) |
equals, hashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, asChars, contains, containsAll, copy, get, indexOf, lastIndexOf, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortInts, toArray, toArrayasInputStream, containsAllInts, containsAnyInts, containsAnyInts, forEach, from, from, intStream, once, once, parallelIntStream, read, removeAllInts, retainAllInts, sequencepublic ArrayIntList()
ArrayIntList.@Deprecated public ArrayIntList(int capacity)
withCapacity(int) instead.ArrayIntList with the given initial capacity.public ArrayIntList(IntCollection xs)
public ArrayIntList(int[] xs)
@Deprecated public static ArrayIntList of(int... xs)
create(int...) instead.IntListIntList of the given elements. The returned IntList's
IntListIterator supports forward iteration only.of in interface IntIterableof in interface IntListArrayIntList initialized with a copy of the given contents.public static ArrayIntList create()
ArrayIntList. When possible, it's preferred to use IntList.create()
instead.create in interface IntListArrayIntList.IntList.create(),
withCapacity(int)public static ArrayIntList create(int... xs)
ArrayIntList initialized with a copy of the given contents. When possible, it's
preferred to use IntList.create(int...) instead.create in interface IntListArrayIntList initialized with a copy of the given contents.IntList.create(int...),
ArrayIntList(IntCollection)public static ArrayIntList withCapacity(int capacity)
ArrayIntList with the given initial capacity.public int size()
size in interface java.util.Collection<java.lang.Integer>size in interface java.util.List<java.lang.Integer>public boolean isEmpty()
isEmpty in interface java.util.Collection<java.lang.Integer>isEmpty in interface java.util.List<java.lang.Integer>isEmpty in interface IntCollectionisEmpty in interface IntIterableisEmpty in interface IntListpublic void clear()
clear in interface java.util.Collection<java.lang.Integer>clear in interface java.util.List<java.lang.Integer>clear in interface IntCollectionclear in interface IntIterableclear in interface IntListpublic int[] toIntArray()
IntCollectionints in this IntCollection into an int-array.toIntArray in interface IntCollectionpublic IntIterator iterator()
iterator in interface java.lang.Iterable<java.lang.Integer>iterator in interface java.util.Collection<java.lang.Integer>iterator in interface java.util.List<java.lang.Integer>iterator in interface IntIterablepublic IntListIterator listIterator(int index)
listIterator in interface java.util.List<java.lang.Integer>listIterator in interface IntListpublic int binarySearch(int x)
binarySearch in interface IntListpublic IntList subList(int from, int to)
public void replaceAllInts(java.util.function.IntUnaryOperator operator)
replaceAllInts in interface IntListpublic int removeIntAt(int index)
removeIntAt in interface IntListpublic int lastIndexOfInt(int x)
lastIndexOfInt in interface IntListpublic int indexOfInt(int x)
indexOfInt in interface IntListpublic java.util.Spliterator.OfInt spliterator()
spliterator in interface java.lang.Iterable<java.lang.Integer>spliterator in interface java.util.Collection<java.lang.Integer>spliterator in interface java.util.List<java.lang.Integer>spliterator in interface IntCollectionspliterator in interface IntIterablespliterator in interface IntListpublic boolean addInt(int x)
addInt in interface IntCollectionaddInt in interface IntListpublic boolean addAllInts(int... xs)
addAllInts in interface IntCollectionaddAllInts in interface IntListpublic boolean addAllInts(IntCollection xs)
addAllInts in interface IntCollectionaddAllInts in interface IntListpublic boolean addAllIntsAt(int index,
int... xs)
addAllIntsAt in interface IntListpublic boolean addAllIntsAt(int index,
IntCollection xs)
addAllIntsAt in interface IntListpublic boolean containsAllInts(int... xs)
containsAllInts in interface IntIterablepublic boolean removeInt(int x)
removeInt in interface IntIterablepublic boolean containsInt(int x)
containsInt in interface IntIterablepublic boolean removeAllInts(int... xs)
removeAllInts in interface IntIterablepublic boolean retainAllInts(int... xs)
retainAllInts in interface IntIterablepublic boolean removeIntsIf(java.util.function.IntPredicate filter)
removeIntsIf in interface IntIterablepublic void forEachInt(java.util.function.IntConsumer consumer)
IntIterableint in this iterable.forEachInt in interface IntIterableprotected void uncheckedAdd(int index,
IntIterable xs,
int xsSize)