LongCollection, LongIterable, LongList, LongStack, Stack<java.lang.Long>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.List<? extends java.lang.Long>>, java.lang.Iterable<java.lang.Long>, java.util.Collection<java.lang.Long>, java.util.List<java.lang.Long>, java.util.RandomAccesspublic static class LongLists.Singleton extends AbstractLongList implements java.util.RandomAccess, java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
AbstractLongList.LongSubList| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addAll(int i,
LongCollection c) |
Inserts all of the elements in the specified type-specific collection into
this type-specific list at the specified position (optional operation).
|
boolean |
addAll(int i,
LongList c) |
Inserts all of the elements in the specified type-specific list into this
type-specific list at the specified position (optional operation).
|
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.Long> c) |
Adds all of the elements in the specified collection to this list (optional
operation).
|
boolean |
addAll(LongCollection c) |
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(LongList c) |
Appends all of the elements in the specified type-specific list to the end of
this type-specific list (optional operation).
|
boolean |
addAll(java.util.Collection<? extends java.lang.Long> c) |
|
void |
clear() |
|
java.lang.Object |
clone() |
|
boolean |
contains(long k) |
Returns true if this list contains the specified element.
|
long |
getLong(int i) |
Returns the element at the specified position in this list.
|
LongListIterator |
iterator() |
Returns a type-specific iterator on the elements of this collection.
|
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.
|
boolean |
rem(long k) |
Removes a single instance of the specified element from this collection, if
it is present (optional operation).
|
boolean |
removeAll(LongCollection c) |
Remove from this collection all elements in the given type-specific
collection.
|
boolean |
removeAll(java.util.Collection<?> c) |
|
long |
removeLong(int i) |
Removes the element at the specified position in this list (optional
operation).
|
boolean |
retainAll(LongCollection c) |
Retains in this collection only elements from the given type-specific
collection.
|
boolean |
retainAll(java.util.Collection<?> c) |
|
int |
size() |
|
void |
size(int size) |
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. |
long[] |
toLongArray() |
Returns a primitive type array containing the items of this collection.
|
add, contains, containsAll, remove, toArray, toLongArrayadd, add, addElements, addElements, compareTo, equals, getElements, hashCode, indexOf, lastIndexOf, peekLong, popLong, push, removeElements, set, topLong, toStringcontainsAll, isEmpty, replaceAll, sort, spliterator, toArray, toArraycontainsAll, removeIf, removeIf, toArray, toLongArrayforEach, forEachpublic long getLong(int i)
LongListpublic boolean rem(long k)
AbstractLongList
This implementation delegates to indexOf().
rem in interface LongCollectionrem in class AbstractLongListList.remove(Object)public long removeLong(int i)
AbstractLongList
This implementation always throws an UnsupportedOperationException.
removeLong in interface LongListremoveLong in class AbstractLongListList.remove(int)public boolean contains(long k)
AbstractLongList
This implementation delegates to indexOf().
contains in interface LongCollectioncontains in class AbstractLongListList.contains(Object)public long[] toLongArray()
LongCollectiontoLongArray in interface LongCollectiontoLongArray in class AbstractLongCollectionCollection.toArray()public LongListIterator listIterator()
AbstractLongList
This implementation delegates to listIterator(0).
listIterator in interface java.util.List<java.lang.Long>listIterator in interface LongListlistIterator in class AbstractLongListList.listIterator()public LongListIterator iterator()
AbstractLongList
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.
This implementation delegates to AbstractLongList.listIterator().
iterator in interface java.util.Collection<java.lang.Long>iterator in interface java.lang.Iterable<java.lang.Long>iterator in interface java.util.List<java.lang.Long>iterator in interface LongCollectioniterator in interface LongIterableiterator in interface LongListiterator in class AbstractLongListIterable.iterator()public LongListIterator listIterator(int i)
AbstractLongListThis implementation is based on the random-access methods.
listIterator in interface java.util.List<java.lang.Long>listIterator in interface LongListlistIterator in class AbstractLongListList.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).
subList in interface java.util.List<java.lang.Long>subList in interface LongListsubList in class AbstractLongListList.subList(int,int)public boolean addAll(int i,
java.util.Collection<? extends java.lang.Long> c)
AbstractLongListaddAll in interface java.util.List<java.lang.Long>addAll in class AbstractLongListpublic boolean addAll(java.util.Collection<? extends java.lang.Long> c)
AbstractLongList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface java.util.Collection<java.lang.Long>addAll in interface java.util.List<java.lang.Long>addAll in class AbstractLongListpublic boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Long>removeAll in interface java.util.List<java.lang.Long>removeAll in class java.util.AbstractCollection<java.lang.Long>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Long>retainAll in interface java.util.List<java.lang.Long>retainAll in class java.util.AbstractCollection<java.lang.Long>public boolean addAll(LongList c)
AbstractLongList
This implementation delegates to the type-specific list version of
List.addAll(int, Collection).
addAll in interface LongListaddAll in class AbstractLongListList.add(int,Object)public boolean addAll(int i,
LongList c)
AbstractLongList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface LongListaddAll in class AbstractLongListList.add(int,Object)public boolean addAll(int i,
LongCollection c)
LongListaddAll in interface LongListaddAll in class AbstractLongListList.addAll(int,java.util.Collection)public boolean addAll(LongCollection c)
AbstractLongList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface LongCollectionaddAll in class AbstractLongListc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean removeAll(LongCollection c)
LongCollectionremoveAll in interface LongCollectionremoveAll in class AbstractLongCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.removeAll(Collection)public boolean retainAll(LongCollection c)
LongCollectionretainAll in interface LongCollectionretainAll in class AbstractLongCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.retainAll(Collection)public int size()
size in interface java.util.Collection<java.lang.Long>size in interface java.util.List<java.lang.Long>size in class java.util.AbstractCollection<java.lang.Long>public void size(int size)
LongList
If the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null/false.
size in interface LongListsize in class AbstractLongListsize - the new size.public void clear()
AbstractLongList
This implementation delegates to AbstractLongList.removeElements(int, int).
clear in interface java.util.Collection<java.lang.Long>clear in interface java.util.List<java.lang.Long>clear in class AbstractLongListpublic java.lang.Object clone()