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, hashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, contains, containsAll, copy, get, indexOf, lastIndexOf, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortLongs, toArray, toArraycontainsAllLongs, containsAnyLongs, containsAnyLongs, forEach, from, from, longStream, once, once, parallelLongStream, removeAllLongs, retainAllLongs, sequencepublic 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.LongListLongList of the given elements. The returned LongList's
LongListIterator supports forward iteration only.of in interface LongIterableof in interface LongListArrayLongList 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 LongListArrayLongList.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 LongListArrayLongList 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 LongCollectionisEmpty in interface LongIterableisEmpty in interface LongListpublic void clear()
clear in interface java.util.Collection<java.lang.Long>clear in interface java.util.List<java.lang.Long>clear in interface LongCollectionclear in interface LongIterableclear in interface LongListpublic long[] toLongArray()
LongCollectionlongs in this LongCollection into an long-array.toLongArray in interface LongCollectionpublic 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 LongIterablepublic LongListIterator listIterator(int index)
listIterator in interface java.util.List<java.lang.Long>listIterator in interface LongListpublic int binarySearch(long x)
binarySearch in interface LongListpublic LongList subList(int from, int to)
public void replaceAllLongs(java.util.function.LongUnaryOperator operator)
replaceAllLongs in interface LongListpublic long removeLongAt(int index)
removeLongAt in interface LongListpublic int lastIndexOfLong(long x)
lastIndexOfLong in interface LongListpublic int indexOfLong(long x)
indexOfLong in interface LongListpublic 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 LongCollectionspliterator in interface LongIterablespliterator in interface LongListpublic boolean addLong(long x)
addLong in interface LongCollectionaddLong in interface LongListpublic boolean addAllLongs(long... xs)
addAllLongs in interface LongCollectionaddAllLongs in interface LongListpublic boolean addAllLongs(LongCollection xs)
addAllLongs in interface LongCollectionaddAllLongs in interface LongListpublic boolean addAllLongsAt(int index,
long... xs)
addAllLongsAt in interface LongListpublic boolean addAllLongsAt(int index,
LongCollection xs)
addAllLongsAt in interface LongListpublic boolean containsAllLongs(long... xs)
containsAllLongs in interface LongIterablepublic boolean removeLong(long x)
removeLong in interface LongIterablepublic boolean containsLong(long x)
containsLong in interface LongIterablepublic boolean removeAllLongs(long... xs)
removeAllLongs in interface LongIterablepublic boolean retainAllLongs(long... xs)
retainAllLongs in interface LongIterablepublic boolean removeLongsIf(java.util.function.LongPredicate filter)
removeLongsIf in interface LongIterablepublic void forEachLong(java.util.function.LongConsumer consumer)
LongIterablelong in this iterable.forEachLong in interface LongIterableprotected void uncheckedAdd(int index,
LongIterable xs,
int xsSize)