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, hashCode
toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, addAll, addAll, asChars, contains, containsAll, copy, get, indexOf, lastIndexOf, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortInts, toArray, toArray
asInputStream, containsAllInts, containsAnyInts, containsAnyInts, forEach, from, from, intStream, once, once, parallelIntStream, read, removeAllInts, retainAllInts, sequence
public 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.IntList
IntList
of the given elements. The returned IntList
's
IntListIterator
supports forward iteration only.of
in interface IntIterable
of
in interface IntList
ArrayIntList
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 IntList
ArrayIntList
.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 IntList
ArrayIntList
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 IntCollection
isEmpty
in interface IntIterable
isEmpty
in interface IntList
public void clear()
clear
in interface java.util.Collection<java.lang.Integer>
clear
in interface java.util.List<java.lang.Integer>
clear
in interface IntCollection
clear
in interface IntIterable
clear
in interface IntList
public int[] toIntArray()
IntCollection
ints
in this IntCollection
into an int
-array.toIntArray
in interface IntCollection
public 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 IntIterable
public IntListIterator listIterator(int index)
listIterator
in interface java.util.List<java.lang.Integer>
listIterator
in interface IntList
public int binarySearch(int x)
binarySearch
in interface IntList
public IntList subList(int from, int to)
public void replaceAllInts(java.util.function.IntUnaryOperator operator)
replaceAllInts
in interface IntList
public int removeIntAt(int index)
removeIntAt
in interface IntList
public int lastIndexOfInt(int x)
lastIndexOfInt
in interface IntList
public int indexOfInt(int x)
indexOfInt
in interface IntList
public 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 IntCollection
spliterator
in interface IntIterable
spliterator
in interface IntList
public boolean addInt(int x)
addInt
in interface IntCollection
addInt
in interface IntList
public boolean addAllInts(int... xs)
addAllInts
in interface IntCollection
addAllInts
in interface IntList
public boolean addAllInts(IntCollection xs)
addAllInts
in interface IntCollection
addAllInts
in interface IntList
public boolean addAllIntsAt(int index, int... xs)
addAllIntsAt
in interface IntList
public boolean addAllIntsAt(int index, IntCollection xs)
addAllIntsAt
in interface IntList
public boolean containsAllInts(int... xs)
containsAllInts
in interface IntIterable
public boolean removeInt(int x)
removeInt
in interface IntIterable
public boolean containsInt(int x)
containsInt
in interface IntIterable
public boolean removeAllInts(int... xs)
removeAllInts
in interface IntIterable
public boolean retainAllInts(int... xs)
retainAllInts
in interface IntIterable
public boolean removeIntsIf(java.util.function.IntPredicate filter)
removeIntsIf
in interface IntIterable
public void forEachInt(java.util.function.IntConsumer consumer)
IntIterable
int
in this iterable.forEachInt
in interface IntIterable
protected void uncheckedAdd(int index, IntIterable xs, int xsSize)