public static class LongLists.Singleton extends AbstractLongList implements Serializable, 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(Collection<? extends Long> c)
Delegates to a more generic method.
|
boolean |
addAll(int i,
Collection<? extends 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() |
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)
|
boolean |
removeAll(Collection<?> c)
Remove from this collection all elements in the given collection.
|
long |
removeLong(int i) |
boolean |
retainAll(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, toArray, toArraycontainsAll, longIterator, removeAll, retainAll, toArray, toArray, toLongArraypublic long getLong(int i)
getLong in interface LongListList.get(int)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(Collection<? extends Long> c)
AbstractLongListaddAll in interface Collection<Long>addAll in interface List<Long>addAll in class AbstractLongListc - a collection.true if this collection changed as a result of the call.public boolean addAll(int i,
Collection<? extends Long> c)
addAll in interface List<Long>addAll in class AbstractLongListpublic 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 retainAll(Collection<?> c)
AbstractLongCollectionretainAll in interface Collection<Long>retainAll in interface List<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 List<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 Iterable<Long>iterator in interface Collection<Long>iterator in interface List<Long>iterator in class AbstractLongListpublic LongListIterator listIterator(int i)
LongListlistIterator in interface LongListlistIterator in interface List<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 List<Long>subList in class AbstractLongListList.subList(int,int)public int size()
size in interface Collection<Long>size in interface List<Long>size in class AbstractCollection<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 Collection<Long>clear in interface List<Long>clear in class AbstractCollection<Long>public 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)