public static class AbstractReferenceBigList.ReferenceSubList<K> extends AbstractReferenceBigList<K> implements Serializable
AbstractReferenceBigList.ReferenceSubList<K>| Constructor and Description |
|---|
ReferenceSubList(ReferenceBigList<K> l,
long from,
long to) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(K k)
Ensures that this collection contains the specified element (optional
operation).
|
void |
add(long index,
K k)
Inserts the specified element at the specified position in this big list (optional operation).
|
boolean |
addAll(long index,
Collection<? extends K> c)
Adds all of the elements in the specified collection to this list
(optional operation).
|
void |
addElements(long index,
K[][] a,
long offset,
long length)
Add (hopefully quickly) elements to this type-specific big list.
|
K |
get(long index)
Returns the element at the specified position.
|
void |
getElements(long from,
Object[][] a,
long offset,
long length)
Copies (hopefully quickly) elements of this type-specific big list into
the given big array.
|
ObjectBigListIterator<K> |
listIterator(long index)
Returns a type-specific list iterator on this type-specific big list
starting at a given index.
|
K |
remove(long index)
Removes the element at the specified position.
|
void |
removeElements(long from,
long to)
Removes (hopefully quickly) elements of this type-specific big list.
|
K |
set(long index,
K k)
Replaces the element at the specified position in this big list with the specified element (optional operation).
|
long |
size64()
Returns the size of this data structure as a long.
|
ReferenceBigList<K> |
subList(long from,
long to)
Returns a type-specific view of the portion of this type-specific big
list from the index
from, inclusive, to the index to,
exclusive. |
addAll, addElements, clear, contains, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, peek, pop, push, size, size, top, toStringcontainsAll, isEmpty, remove, removeAll, retainAll, toArray, toArraycontainsAll, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic ReferenceSubList(ReferenceBigList<K> l, long from, long to)
public boolean add(K k)
AbstractReferenceBigListCollections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.
If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.
This implementation always throws an UnsupportedOperationException.
This implementation delegates to the type-specific version of
BigList.add(long, Object).
add in interface Collection<K>add in class AbstractReferenceBigList<K>k - element whose presence in this collection is to be ensuredpublic void add(long index,
K k)
AbstractReferenceBigList
This implementation always throws an
UnsupportedOperationException.
add in interface BigList<K>add in class AbstractReferenceBigList<K>index - a position in the big list.k - an element to be inserted.List.add(int,Object)public boolean addAll(long index,
Collection<? extends K> c)
AbstractReferenceBigListaddAll in interface BigList<K>addAll in class AbstractReferenceBigList<K>index - index at which to insert the first element from the specified collection.c - collection containing elements to be added to this big list.true if this big list changed as a result of the callList.addAll(int, Collection)public K get(long index)
BigListget in interface BigList<K>index - a position in the big list.List.get(int)public K remove(long index)
AbstractReferenceBigList
This implementation always throws an
UnsupportedOperationException.
remove in interface BigList<K>remove in class AbstractReferenceBigList<K>index - a position in the big list.List.remove(int)public K set(long index, K k)
AbstractReferenceBigList
This implementation always throws an
UnsupportedOperationException.
set in interface BigList<K>set in class AbstractReferenceBigList<K>index - a position in the big list.k - the element to be stored at the specified position.List.set(int,Object)public long size64()
Size64public void getElements(long from,
Object[][] a,
long offset,
long length)
AbstractReferenceBigListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface ReferenceBigList<K>getElements in class AbstractReferenceBigList<K>from - the start index (inclusive).a - the destination big array.offset - the offset into the destination big array where to store the
first element copied.length - the number of elements to be copied.public void removeElements(long from,
long to)
AbstractReferenceBigListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface ReferenceBigList<K>removeElements in class AbstractReferenceBigList<K>from - the start index (inclusive).to - the end index (exclusive).public void addElements(long index,
K[][] a,
long offset,
long length)
AbstractReferenceBigListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface ReferenceBigList<K>addElements in class AbstractReferenceBigList<K>index - the index at which to add elements.a - the big array containing the elements.offset - the offset of the first element to add.length - the number of elements to add.public ObjectBigListIterator<K> listIterator(long index)
AbstractReferenceBigList
Note that this specification strengthens the one given in
BigList.listIterator(long).
This implementation is based on the random-access methods.
listIterator in interface BigList<K>listIterator in interface ReferenceBigList<K>listIterator in class AbstractReferenceBigList<K>index - index of first element to be returned from the big-list iterator.BigList.listIterator(long)public ReferenceBigList<K> subList(long from, long to)
ReferenceBigListfrom, inclusive, to the index to,
exclusive.
Note that this specification strengthens the one given in
BigList.subList(long,long).
subList in interface BigList<K>subList in interface ReferenceBigList<K>subList in class AbstractReferenceBigList<K>from - the starting element (inclusive).to - the ending element (exclusive).BigList.subList(long,long)