public static class ReferenceBigLists.ListBigList<K> extends AbstractReferenceBigList<K> implements java.io.Serializable
AbstractReferenceBigList.ReferenceRandomAccessSubList<K>, AbstractReferenceBigList.ReferenceSubList<K>
Modifier and Type | Method and Description |
---|---|
boolean |
add(K key) |
void |
add(long index,
K key)
Inserts the specified element at the specified position in this big list (optional operation).
|
boolean |
addAll(java.util.Collection<? extends K> c) |
boolean |
addAll(long index,
java.util.Collection<? extends K> c)
Adds all of the elements in the specified collection to this list (optional operation).
|
void |
clear() |
boolean |
contains(java.lang.Object key)
Returns true if this list contains the specified element.
|
boolean |
containsAll(java.util.Collection<?> c) |
K |
get(long index)
Returns the element at the specified position.
|
int |
hashCode()
Returns the hash code for this big list, which is identical to
List.hashCode() . |
long |
indexOf(java.lang.Object k)
Returns the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
|
boolean |
isEmpty()
Checks whether the stack is empty.
|
ObjectBigListIterator<K> |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
long |
lastIndexOf(java.lang.Object k)
Returns the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
|
ObjectBigListIterator<K> |
listIterator()
Returns a type-specific big-list iterator on this type-specific big list.
|
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.
|
boolean |
removeAll(java.util.Collection<?> c) |
void |
removeElements(long from,
long to)
Removes (hopefully quickly) elements of this type-specific big list.
|
boolean |
retainAll(java.util.Collection<?> c) |
K |
set(long index,
K k)
Replaces the element at the specified position in this big list with the specified element (optional operation).
|
void |
size(long size)
Sets the size of this big list.
|
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. |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
addElements, addElements, equals, forEach, getElements, peek, pop, push, setElements, size, top, toString
addAll, addAll, addAll, addAll, setElements, setElements, spliterator
public long size64()
Size64
public void size(long size)
BigList
If the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null
/false
.
public ObjectBigListIterator<K> iterator()
AbstractReferenceBigList
iterator
in interface ObjectIterable<K>
iterator
in interface ReferenceBigList<K>
iterator
in interface ReferenceCollection<K>
iterator
in interface java.lang.Iterable<K>
iterator
in interface java.util.Collection<K>
iterator
in class AbstractReferenceBigList<K>
Iterable.iterator()
public ObjectBigListIterator<K> listIterator()
AbstractReferenceBigList
listIterator
in interface BigList<K>
listIterator
in interface ReferenceBigList<K>
listIterator
in class AbstractReferenceBigList<K>
BigList.listIterator()
public ObjectBigListIterator<K> listIterator(long index)
AbstractReferenceBigList
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 boolean addAll(long index, java.util.Collection<? extends K> c)
AbstractReferenceBigList
addAll
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 ReferenceBigList<K> subList(long from, long to)
ReferenceBigList
from
, inclusive, to the index to
, exclusive.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)
public boolean contains(java.lang.Object key)
AbstractReferenceBigList
contains
in interface java.util.Collection<K>
contains
in class AbstractReferenceBigList<K>
Collection.contains(Object)
public java.lang.Object[] toArray()
public void removeElements(long from, long to)
AbstractReferenceBigList
This 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 add(long index, K key)
AbstractReferenceBigList
public boolean add(K key)
AbstractReferenceBigList
add
in interface java.util.Collection<K>
add
in class AbstractReferenceBigList<K>
public K get(long index)
BigList
public long indexOf(java.lang.Object k)
BigList
indexOf
in interface BigList<K>
indexOf
in class AbstractReferenceBigList<K>
k
- the object to search for.List.indexOf(Object)
public long lastIndexOf(java.lang.Object k)
BigList
lastIndexOf
in interface BigList<K>
lastIndexOf
in class AbstractReferenceBigList<K>
k
- the object to search for.List.lastIndexOf(Object)
public K remove(long index)
AbstractReferenceBigList
public K set(long index, K k)
AbstractReferenceBigList
public boolean isEmpty()
Stack
public <T> T[] toArray(T[] a)
public boolean containsAll(java.util.Collection<?> c)
public boolean addAll(java.util.Collection<? extends K> c)
AbstractReferenceBigList
addAll
in interface java.util.Collection<K>
addAll
in class AbstractReferenceBigList<K>
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public void clear()
AbstractReferenceBigList
clear
in interface java.util.Collection<K>
clear
in class AbstractReferenceBigList<K>
public int hashCode()
AbstractReferenceBigList
List.hashCode()
.hashCode
in interface java.util.Collection<K>
hashCode
in class AbstractReferenceBigList<K>