public static class LongLists.EmptyList extends LongCollections.EmptyCollection implements LongList, Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
long k) |
void |
add(int index,
Long k) |
boolean |
add(long k) |
boolean |
add(Long k)
Delegates to the corresponding type-specific method.
|
boolean |
addAll(Collection<? extends Long> c)
Adds all elements of the given collection to this collection.
|
boolean |
addAll(int i,
Collection<? extends Long> c) |
boolean |
addAll(int i,
LongCollection c) |
boolean |
addAll(int i,
LongList c) |
boolean |
addAll(LongCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(LongList c) |
void |
addElements(int index,
long[] a)
Add (hopefully quickly) elements to this type-specific list.
|
void |
addElements(int index,
long[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
Object |
clone() |
int |
compareTo(List<? extends Long> o) |
Long |
get(int i) |
void |
getElements(int from,
long[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array.
|
long |
getLong(int i) |
int |
indexOf(long k) |
int |
indexOf(Object k) |
LongListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
int |
lastIndexOf(long k) |
int |
lastIndexOf(Object k) |
LongListIterator |
listIterator()
Returns a type-specific list iterator on the list.
|
LongListIterator |
listIterator(int i)
Returns a type-specific list iterator on the list starting at a given index.
|
LongIterator |
longIterator()
Deprecated.
|
LongListIterator |
longListIterator()
Deprecated.
|
LongListIterator |
longListIterator(int i)
Deprecated.
|
LongList |
longSubList(int from,
int to)
Deprecated.
|
Long |
remove(int k) |
boolean |
removeAll(Collection<?> c)
Remove from this collection all elements in the given collection.
|
void |
removeElements(int from,
int to)
Removes (hopefully quickly) elements of this type-specific list.
|
long |
removeLong(int i) |
long |
set(int index,
long k) |
Long |
set(int index,
Long k) |
void |
size(int s)
Sets the size of this list.
|
LongList |
subList(int from,
int to)
Returns a type-specific view of the portion of this list from the index
from, inclusive, to the index to, exclusive. |
clear, contains, containsAll, equals, hashCode, rem, removeAll, retainAll, size, toArray, toLongArray, toLongArraycontains, containsAll, isEmpty, rem, remove, retainAll, toArray, toArray, toStringclear, contains, containsAll, equals, hashCode, isEmpty, remove, retainAll, size, toArray, toArraycontains, containsAll, rem, removeAll, retainAll, toArray, toArray, toLongArray, toLongArraypublic void add(int index,
long k)
add in interface LongListList.add(int,Object)public boolean add(long k)
add in interface LongCollectionadd in interface LongListadd in class LongCollections.EmptyCollectionCollection.add(Object)public long removeLong(int i)
removeLong in interface LongListList.remove(int)public long set(int index,
long k)
set in interface LongListList.set(int,Object)public int indexOf(long k)
indexOf in interface LongListList.indexOf(Object)public int lastIndexOf(long k)
lastIndexOf in interface LongListList.lastIndexOf(Object)public boolean addAll(Collection<? extends Long> c)
AbstractLongCollectionaddAll in interface Collection<Long>addAll in interface List<Long>addAll in class AbstractLongCollectionc - a collection.true if this collection changed as a result of the call.public boolean addAll(int i,
Collection<? extends Long> c)
public boolean removeAll(Collection<?> c)
AbstractLongCollectionremoveAll in interface Collection<Long>removeAll in interface List<Long>removeAll in class AbstractLongCollectionc - a collection.true if this collection changed as a result of the call.public boolean addAll(LongCollection c)
AbstractLongCollectionaddAll in interface LongCollectionaddAll in class LongCollections.EmptyCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean addAll(LongList c)
addAll in interface LongListList.add(int,Object)public boolean addAll(int i,
LongCollection c)
addAll in interface LongListList.add(int,Object)public boolean addAll(int i,
LongList c)
addAll in interface LongListList.add(int,Object)public boolean add(Long k)
AbstractLongCollectionadd in interface Collection<Long>add in interface List<Long>add in class AbstractLongCollectionpublic long getLong(int i)
getLong in interface LongListList.get(int)public int lastIndexOf(Object k)
lastIndexOf in interface List<Long>@Deprecated public LongIterator longIterator()
AbstractLongCollectionlongIterator in interface LongCollectionlongIterator in class AbstractLongCollectionLongCollection.iterator()public LongListIterator listIterator()
LongListlistIterator in interface LongListlistIterator in interface List<Long>List.listIterator()public LongListIterator iterator()
LongCollectionNote that this specification strengthens the one given in
Iterable.iterator(), which was already
strengthened in the corresponding type-specific class,
but was weakened by the fact that this interface extends Collection.
iterator in interface LongCollectioniterator in interface LongIterableiterator in interface LongListiterator in interface Iterable<Long>iterator in interface Collection<Long>iterator in interface List<Long>iterator in class LongCollections.EmptyCollectionpublic LongListIterator listIterator(int i)
LongListlistIterator in interface LongListlistIterator in interface List<Long>List.listIterator(int)@Deprecated public LongListIterator longListIterator()
LongListlongListIterator in interface LongListLongList.listIterator()@Deprecated public LongListIterator longListIterator(int i)
LongListlongListIterator in interface LongListLongList.listIterator(int)public LongList subList(int from, int to)
LongListfrom, inclusive, to the index to, exclusive.
Note that this specification strengthens the one given in List.subList(int,int).
@Deprecated public LongList longSubList(int from, int to)
LongListfrom, inclusive, to the index to, exclusive.longSubList in interface LongListList.subList(int,int)public void getElements(int from,
long[] a,
int offset,
int length)
LongListgetElements in interface LongListfrom - the start index (inclusive).a - the destination array.offset - the offset into the destination array where to store the first element copied.length - the number of elements to be copied.public void removeElements(int from,
int to)
LongListremoveElements in interface LongListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
long[] a,
int offset,
int length)
LongListaddElements in interface LongListindex - the index at which to add elements.a - the array containing the elements.offset - the offset of the first element to add.length - the number of elements to add.public void addElements(int index,
long[] a)
LongListaddElements in interface LongListindex - the index at which to add elements.a - the array containing the elements.public void size(int s)
LongListIf the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null/false.
public int compareTo(List<? extends Long> o)
compareTo in interface Comparable<List<? extends Long>>