public class ArrayLongList extends LongList.Base implements LongList, java.util.RandomAccess
LongList.Base
Constructor and Description |
---|
ArrayLongList()
Create a new mutable
ArrayLongList . |
ArrayLongList(int capacity)
Deprecated.
Use
withCapacity(int) instead. |
ArrayLongList(long[] xs) |
ArrayLongList(LongCollection xs) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAllLongs(long... xs) |
boolean |
addAllLongs(LongCollection xs) |
boolean |
addAllLongsAt(int index,
long... xs) |
boolean |
addAllLongsAt(int index,
LongCollection xs) |
boolean |
addLong(long x) |
void |
addLongAt(int index,
long x) |
int |
binarySearch(long x) |
void |
clear() |
boolean |
containsAllLongs(long... xs) |
boolean |
containsLong(long x) |
static ArrayLongList |
create()
Create a new empty mutable
ArrayLongList . |
static ArrayLongList |
create(long... xs)
Create a new mutable
ArrayLongList initialized with a copy of the given contents. |
void |
forEachLong(java.util.function.LongConsumer consumer)
Performs the given action for each
long in this iterable. |
long |
getLong(int index) |
int |
indexOfLong(long x) |
boolean |
isEmpty() |
LongIterator |
iterator() |
int |
lastIndexOfLong(long x) |
LongListIterator |
listIterator(int index) |
static ArrayLongList |
of(long... xs)
Deprecated.
Use
create(long...) instead. |
boolean |
removeAllLongs(long... xs) |
boolean |
removeLong(long x) |
long |
removeLongAt(int index) |
boolean |
removeLongsIf(java.util.function.LongPredicate filter) |
void |
replaceAllLongs(java.util.function.LongUnaryOperator operator) |
boolean |
retainAllLongs(long... xs) |
long |
setLong(int index,
long x) |
int |
size() |
void |
sortLongs() |
java.util.Spliterator.OfLong |
spliterator() |
LongList |
subList(int from,
int to) |
long[] |
toLongArray()
Collect the
longs in this LongCollection into an long -array. |
protected void |
uncheckedAdd(int index,
LongIterable xs,
int xsSize) |
static ArrayLongList |
withCapacity(int capacity) |
equals, hashCode
toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, addAll, addAll, contains, containsAll, copy, get, indexOf, lastIndexOf, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortLongs, toArray, toArray
containsAllLongs, containsAnyLongs, containsAnyLongs, forEach, from, from, longStream, once, once, parallelLongStream, removeAllLongs, retainAllLongs, sequence
public ArrayLongList()
ArrayLongList
.@Deprecated public ArrayLongList(int capacity)
withCapacity(int)
instead.ArrayLongList
with the given initial capacity.public ArrayLongList(LongCollection xs)
public ArrayLongList(long[] xs)
@Deprecated public static ArrayLongList of(long... xs)
create(long...)
instead.LongList
LongList
of the given elements. The returned LongList
's
LongListIterator
supports forward iteration only.of
in interface LongIterable
of
in interface LongList
ArrayLongList
initialized with a copy of the given contents.public static ArrayLongList create()
ArrayLongList
. When possible, it's preferred to use LongList.create()
instead.create
in interface LongList
ArrayLongList
.LongList.create()
,
withCapacity(int)
public static ArrayLongList create(long... xs)
ArrayLongList
initialized with a copy of the given contents. When possible, it's
preferred to use LongList.create(long...)
instead.create
in interface LongList
ArrayLongList
initialized with a copy of the given contents.LongList.create(long...)
,
ArrayLongList(LongCollection)
public static ArrayLongList withCapacity(int capacity)
ArrayLongList
with the given initial capacity.public int size()
size
in interface java.util.Collection<java.lang.Long>
size
in interface java.util.List<java.lang.Long>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<java.lang.Long>
isEmpty
in interface java.util.List<java.lang.Long>
isEmpty
in interface LongCollection
isEmpty
in interface LongIterable
isEmpty
in interface LongList
public void clear()
clear
in interface java.util.Collection<java.lang.Long>
clear
in interface java.util.List<java.lang.Long>
clear
in interface LongCollection
clear
in interface LongIterable
clear
in interface LongList
public long[] toLongArray()
LongCollection
longs
in this LongCollection
into an long
-array.toLongArray
in interface LongCollection
public LongIterator iterator()
iterator
in interface java.lang.Iterable<java.lang.Long>
iterator
in interface java.util.Collection<java.lang.Long>
iterator
in interface java.util.List<java.lang.Long>
iterator
in interface LongIterable
public LongListIterator listIterator(int index)
listIterator
in interface java.util.List<java.lang.Long>
listIterator
in interface LongList
public int binarySearch(long x)
binarySearch
in interface LongList
public LongList subList(int from, int to)
public void replaceAllLongs(java.util.function.LongUnaryOperator operator)
replaceAllLongs
in interface LongList
public long removeLongAt(int index)
removeLongAt
in interface LongList
public int lastIndexOfLong(long x)
lastIndexOfLong
in interface LongList
public int indexOfLong(long x)
indexOfLong
in interface LongList
public java.util.Spliterator.OfLong spliterator()
spliterator
in interface java.lang.Iterable<java.lang.Long>
spliterator
in interface java.util.Collection<java.lang.Long>
spliterator
in interface java.util.List<java.lang.Long>
spliterator
in interface LongCollection
spliterator
in interface LongIterable
spliterator
in interface LongList
public boolean addLong(long x)
addLong
in interface LongCollection
addLong
in interface LongList
public boolean addAllLongs(long... xs)
addAllLongs
in interface LongCollection
addAllLongs
in interface LongList
public boolean addAllLongs(LongCollection xs)
addAllLongs
in interface LongCollection
addAllLongs
in interface LongList
public boolean addAllLongsAt(int index, long... xs)
addAllLongsAt
in interface LongList
public boolean addAllLongsAt(int index, LongCollection xs)
addAllLongsAt
in interface LongList
public boolean containsAllLongs(long... xs)
containsAllLongs
in interface LongIterable
public boolean removeLong(long x)
removeLong
in interface LongIterable
public boolean containsLong(long x)
containsLong
in interface LongIterable
public boolean removeAllLongs(long... xs)
removeAllLongs
in interface LongIterable
public boolean retainAllLongs(long... xs)
retainAllLongs
in interface LongIterable
public boolean removeLongsIf(java.util.function.LongPredicate filter)
removeLongsIf
in interface LongIterable
public void forEachLong(java.util.function.LongConsumer consumer)
LongIterable
long
in this iterable.forEachLong
in interface LongIterable
protected void uncheckedAdd(int index, LongIterable xs, int xsSize)