public static class LongLists.EmptyList extends LongCollections.EmptyCollection implements LongList, java.io.Serializable, java.lang.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,
java.lang.Long k) |
boolean |
add(long k) |
boolean |
add(java.lang.Long k)
Delegates to the corresponding type-specific method.
|
boolean |
addAll(java.util.Collection<? extends java.lang.Long> c)
Adds all elements of the given collection to this collection.
|
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.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.
|
java.lang.Object |
clone() |
int |
compareTo(java.util.List<? extends java.lang.Long> o) |
java.lang.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(java.lang.Object k) |
LongListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
int |
lastIndexOf(long k) |
int |
lastIndexOf(java.lang.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.
|
java.lang.Long |
remove(int k) |
boolean |
removeAll(java.util.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) |
java.lang.Long |
set(int index,
java.lang.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, toLongArray
contains, containsAll, isEmpty, rem, remove, retainAll, toArray, toArray, toString
clear, contains, containsAll, equals, hashCode, isEmpty, remove, replaceAll, retainAll, size, sort, spliterator, toArray, toArray
contains, containsAll, rem, removeAll, retainAll, toArray, toArray, toLongArray, toLongArray
public void add(int index, long k)
public boolean add(long k)
add
in interface LongCollection
add
in interface LongList
add
in class LongCollections.EmptyCollection
Collection.add(Object)
public long removeLong(int i)
removeLong
in interface LongList
List.remove(int)
public long set(int index, long k)
public int indexOf(long k)
public int lastIndexOf(long k)
lastIndexOf
in interface LongList
List.lastIndexOf(Object)
public boolean addAll(java.util.Collection<? extends java.lang.Long> c)
AbstractLongCollection
addAll
in interface java.util.Collection<java.lang.Long>
addAll
in interface java.util.List<java.lang.Long>
addAll
in class AbstractLongCollection
c
- a collection.true
if this collection changed as a result of the call.public boolean addAll(int i, java.util.Collection<? extends java.lang.Long> c)
addAll
in interface java.util.List<java.lang.Long>
public boolean removeAll(java.util.Collection<?> c)
AbstractLongCollection
removeAll
in interface java.util.Collection<java.lang.Long>
removeAll
in interface java.util.List<java.lang.Long>
removeAll
in class AbstractLongCollection
c
- a collection.true
if this collection changed as a result of the call.public java.lang.Long get(int i)
get
in interface java.util.List<java.lang.Long>
public boolean addAll(LongCollection c)
AbstractLongCollection
addAll
in interface LongCollection
addAll
in class LongCollections.EmptyCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean addAll(LongList c)
public boolean addAll(int i, LongCollection c)
public boolean addAll(int i, LongList c)
public void add(int index, java.lang.Long k)
add
in interface java.util.List<java.lang.Long>
public boolean add(java.lang.Long k)
AbstractLongCollection
add
in interface java.util.Collection<java.lang.Long>
add
in interface java.util.List<java.lang.Long>
add
in class AbstractLongCollection
public java.lang.Long set(int index, java.lang.Long k)
set
in interface java.util.List<java.lang.Long>
public long getLong(int i)
public java.lang.Long remove(int k)
remove
in interface java.util.List<java.lang.Long>
public int indexOf(java.lang.Object k)
indexOf
in interface java.util.List<java.lang.Long>
public int lastIndexOf(java.lang.Object k)
lastIndexOf
in interface java.util.List<java.lang.Long>
@Deprecated public LongIterator longIterator()
AbstractLongCollection
longIterator
in interface LongCollection
longIterator
in class AbstractLongCollection
LongCollection.iterator()
public LongListIterator listIterator()
LongList
listIterator
in interface LongList
listIterator
in interface java.util.List<java.lang.Long>
List.listIterator()
public LongListIterator iterator()
LongCollection
Note 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 LongCollection
iterator
in interface LongIterable
iterator
in interface LongList
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 class LongCollections.EmptyCollection
public LongListIterator listIterator(int i)
LongList
listIterator
in interface LongList
listIterator
in interface java.util.List<java.lang.Long>
List.listIterator(int)
@Deprecated public LongListIterator longListIterator()
LongList
longListIterator
in interface LongList
LongList.listIterator()
@Deprecated public LongListIterator longListIterator(int i)
LongList
longListIterator
in interface LongList
LongList.listIterator(int)
public LongList subList(int from, int to)
LongList
from
, 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)
LongList
from
, inclusive, to the index to
, exclusive.longSubList
in interface LongList
List.subList(int,int)
public void getElements(int from, long[] a, int offset, int length)
LongList
getElements
in interface LongList
from
- 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)
LongList
removeElements
in interface LongList
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, long[] a, int offset, int length)
LongList
addElements
in interface LongList
index
- 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)
LongList
addElements
in interface LongList
index
- the index at which to add elements.a
- the array containing the elements.public void size(int s)
LongList
If 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(java.util.List<? extends java.lang.Long> o)
compareTo
in interface java.lang.Comparable<java.util.List<? extends java.lang.Long>>
public java.lang.Object clone()
clone
in class java.lang.Object