public class LongList extends AbstractList<Long> implements Serializable
ArrayList
to store longs.
Null is not allowed into the list.modCount
Constructor and Description |
---|
LongList()
Creates a new LongList
|
LongList(Collection<Long> c) |
LongList(int capacity)
Creates a new LongList with the given initial capacity
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
long element)
Operates exactly as
add(int, java.lang.Long) |
void |
add(int index,
Long element) |
boolean |
add(long e)
Operates exactly as
add(java.lang.Long) |
boolean |
add(Long e) |
void |
clear() |
Long |
get(int index) |
long |
getL(int index)
Operates exactly as
get(int) |
Long |
remove(int index) |
long |
set(int index,
long element)
Operates exactly as
set(int, java.lang.Long) |
Long |
set(int index,
Long element) |
int |
size() |
static List<Long> |
view(long[] array,
int length)
Creates and returns a view of the given long array that
requires only a small object allocation.
|
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public LongList()
public LongList(int capacity)
capacity
- the starting internal storage space sizepublic LongList(Collection<Long> c)
public void clear()
clear
in interface Collection<Long>
clear
in interface List<Long>
clear
in class AbstractList<Long>
public long set(int index, long element)
set(int, java.lang.Long)
index
- the index to setelement
- the value to setpublic void add(int index, long element)
add(int, java.lang.Long)
index
- the index to add the value intoelement
- the value to addpublic void add(int index, Long element)
public boolean add(long e)
add(java.lang.Long)
e
- the value to addpublic boolean add(Long e)
add
in interface Collection<Long>
add
in interface List<Long>
add
in class AbstractList<Long>
public long getL(int index)
get(int)
index
- the index of the value to getpublic Long get(int index)
public int size()
size
in interface Collection<Long>
size
in interface List<Long>
size
in class AbstractCollection<Long>
public Long remove(int index)
public static List<Long> view(long[] array, int length)
array
- the array to wrap into a listlength
- the number of values of the array to use, starting from zeroCopyright © 2017. All rights reserved.