public static class ObjectBigLists.ListBigList<K> extends AbstractObjectBigList<K> implements java.io.Serializable
AbstractObjectBigList.ObjectRandomAccessSubList<K>, AbstractObjectBigList.ObjectSubList<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.
|
ObjectBigList<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, compareTo, 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()
AbstractObjectBigList
iterator
in interface ObjectBigList<K>
iterator
in interface ObjectCollection<K>
iterator
in interface ObjectIterable<K>
iterator
in interface java.lang.Iterable<K>
iterator
in interface java.util.Collection<K>
iterator
in class AbstractObjectBigList<K>
Iterable.iterator()
public ObjectBigListIterator<K> listIterator()
AbstractObjectBigList
listIterator
in interface BigList<K>
listIterator
in interface ObjectBigList<K>
listIterator
in class AbstractObjectBigList<K>
BigList.listIterator()
public ObjectBigListIterator<K> listIterator(long index)
AbstractObjectBigList
listIterator
in interface BigList<K>
listIterator
in interface ObjectBigList<K>
listIterator
in class AbstractObjectBigList<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)
AbstractObjectBigList
addAll
in interface BigList<K>
addAll
in class AbstractObjectBigList<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 ObjectBigList<K> subList(long from, long to)
ObjectBigList
from
, inclusive, to the index to
, exclusive.subList
in interface BigList<K>
subList
in interface ObjectBigList<K>
subList
in class AbstractObjectBigList<K>
from
- the starting element (inclusive).to
- the ending element (exclusive).BigList.subList(long,long)
public boolean contains(java.lang.Object key)
AbstractObjectBigList
contains
in interface java.util.Collection<K>
contains
in class AbstractObjectBigList<K>
Collection.contains(Object)
public java.lang.Object[] toArray()
public void removeElements(long from, long to)
AbstractObjectBigList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface ObjectBigList<K>
removeElements
in class AbstractObjectBigList<K>
from
- the start index (inclusive).to
- the end index (exclusive).public void add(long index, K key)
AbstractObjectBigList
public boolean add(K key)
AbstractObjectBigList
add
in interface java.util.Collection<K>
add
in class AbstractObjectBigList<K>
public K get(long index)
BigList
public long indexOf(java.lang.Object k)
BigList
indexOf
in interface BigList<K>
indexOf
in class AbstractObjectBigList<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 AbstractObjectBigList<K>
k
- the object to search for.List.lastIndexOf(Object)
public K remove(long index)
AbstractObjectBigList
public K set(long index, K k)
AbstractObjectBigList
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)
AbstractObjectBigList
addAll
in interface java.util.Collection<K>
addAll
in class AbstractObjectBigList<K>
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public void clear()
AbstractObjectBigList
clear
in interface java.util.Collection<K>
clear
in class AbstractObjectBigList<K>
public int hashCode()
AbstractObjectBigList
List.hashCode()
.hashCode
in interface java.util.Collection<K>
hashCode
in class AbstractObjectBigList<K>