public static class LongLists.Singleton extends AbstractLongList implements 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 and Description |
|---|---|
boolean |
addAll(java.util.Collection<? extends java.lang.Long> c)
Delegates to a more generic method.
|
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.Long> c) |
boolean |
addAll(int i,
LongCollection c)
Delegates to a more generic method.
|
boolean |
addAll(LongCollection c)
Adds all elements of the given type-specific collection to this collection.
|
void |
clear() |
java.lang.Object |
clone() |
boolean |
contains(long k) |
long |
getLong(int i) |
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)
Note that this method should be called
remove(), but the clash
with the similarly named index-based method in the List interface
forces us to use a distinguished name. |
boolean |
removeAll(java.util.Collection<?> c)
Remove from this collection all elements in the given collection.
|
long |
removeLong(int i) |
boolean |
retainAll(java.util.Collection<?> c)
Retains in this collection only elements from the given collection.
|
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, add, add, addAll, addAll, addElements, addElements, compareTo, equals, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, longListIterator, longListIterator, longSubList, peek, peekLong, pop, popLong, push, push, remove, remove, removeElements, set, set, top, topLong, toStringadd, contains, containsAll, containsAll, isEmpty, longIterator, rem, removeAll, retainAll, toArray, toArray, toArray, toLongArrayadd, contains, containsAll, isEmpty, replaceAll, sort, spliterator, toArray, toArraycontainsAll, longIterator, removeAll, retainAll, toArray, toArray, toLongArraypublic long getLong(int i)
public long removeLong(int i)
removeLong in interface LongListremoveLong in class AbstractLongListList.remove(int)public boolean contains(long k)
contains in interface LongCollectioncontains in class AbstractLongListCollection.contains(Object)public boolean addAll(java.util.Collection<? extends java.lang.Long> c)
AbstractLongListaddAll in interface java.util.Collection<java.lang.Long>addAll in interface java.util.List<java.lang.Long>addAll in class AbstractLongListc - 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>addAll in class AbstractLongListpublic boolean removeAll(java.util.Collection<?> c)
AbstractLongCollectionremoveAll in interface java.util.Collection<java.lang.Long>removeAll in interface java.util.List<java.lang.Long>removeAll in class AbstractLongCollectionc - a collection.true if this collection changed as a result of the call.public boolean retainAll(java.util.Collection<?> c)
AbstractLongCollectionretainAll in interface java.util.Collection<java.lang.Long>retainAll in interface java.util.List<java.lang.Long>retainAll in class AbstractLongCollectionc - a collection.true if this collection changed as a result of the call.public long[] toLongArray()
LongCollectiontoLongArray in interface LongCollectiontoLongArray in class AbstractLongCollectionCollection.toArray()public LongListIterator listIterator()
LongListlistIterator in interface LongListlistIterator in interface java.util.List<java.lang.Long>listIterator in class AbstractLongListList.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 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 AbstractLongListpublic LongListIterator listIterator(int i)
LongListlistIterator in interface LongListlistIterator in interface java.util.List<java.lang.Long>listIterator 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 LongListsubList in interface java.util.List<java.lang.Long>subList in class AbstractLongListList.subList(int,int)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)
LongListIf 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()
clear in interface java.util.Collection<java.lang.Long>clear in interface java.util.List<java.lang.Long>clear in class java.util.AbstractCollection<java.lang.Long>public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean rem(long k)
LongCollectionremove(), but the clash
with the similarly named index-based method in the List interface
forces us to use a distinguished name. For simplicity, the set interfaces reinstates
remove().rem in interface LongCollectionrem in class AbstractLongListCollection.remove(Object)public boolean addAll(LongCollection c)
AbstractLongCollectionaddAll 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 addAll(int i,
LongCollection c)
AbstractLongListaddAll in interface LongListaddAll in class AbstractLongListList.add(int,Object)