Class ShortBigLists.ListBigList
- All Implemented Interfaces:
BigList<Short>,ShortBigList,ShortCollection,ShortIterable,ShortStack,Size64,Stack<Short>,Serializable,Comparable<BigList<? extends Short>>,Iterable<Short>,Collection<Short>
- Enclosing class:
- ShortBigLists
public static class ShortBigLists.ListBigList extends AbstractShortBigList implements Serializable
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortBigList
AbstractShortBigList.ShortSubList -
Method Summary
Modifier and Type Method Description voidadd(long index, short key)Inserts the specified element at the specified position in this type-specific big list (optional operation).booleanadd(short key)Ensures that this collection contains the specified element (optional operation).booleanaddAll(long index, ShortBigList c)Inserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).booleanaddAll(long index, ShortCollection c)Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).booleanaddAll(long index, Collection<? extends Short> c)Adds all of the elements in the specified collection to this list (optional operation).booleanaddAll(ShortBigList c)Appends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).booleanaddAll(ShortCollection c)Adds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Short> c)voidclear()booleancontains(short key)Returns true if this list contains the specified element.booleancontainsAll(ShortCollection c)Checks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(Collection<?> c)shortgetShort(long index)Returns the element at the specified position.inthashCode()Returns the hash code for this big list, which is identical toList.hashCode().longindexOf(short k)Returns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.booleanisEmpty()Checks whether the stack is empty.ShortBigListIteratoriterator()Returns a type-specific iterator on the elements of this collection.longlastIndexOf(short k)Returns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.ShortBigListIteratorlistIterator()Returns a type-specific big-list iterator on this type-specific big list.ShortBigListIteratorlistIterator(long index)Returns a type-specific list iterator on this type-specific big list starting at a given index.booleanremoveAll(ShortCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c)voidremoveElements(long from, long to)Removes (hopefully quickly) elements of this type-specific big list.shortremoveShort(long index)Removes the element at the specified position.booleanretainAll(ShortCollection c)Retains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c)shortset(long index, short k)Replaces the element at the specified position in this big list with the specified element (optional operation).voidsize(long size)Sets the size of this big list.longsize64()Returns the size of this data structure as a long.ShortBigListsubList(long from, long to)Returns a type-specific view of the portion of this type-specific big list from the indexfrom, inclusive, to the indexto, exclusive.<T> T[]toArray(T[] a)short[]toShortArray()Returns a primitive type array containing the items of this collection.short[]toShortArray(short[] a)Deprecated.Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortBigList
add, addElements, addElements, compareTo, equals, get, getElements, indexOf, lastIndexOf, peek, peekShort, pop, popShort, push, push, rem, remove, set, size, top, topShort, toStringMethods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
add, contains, remove, toArrayMethods inherited from interface java.util.Collection
parallelStream, spliterator, stream, toArray, toArray
-
Method Details
-
size64
public long size64()Description copied from interface:Size64Returns the size of this data structure as a long. -
size
public void size(long size)Description copied from interface:BigListSets the size of this big list.If the specified size is smaller than the current size, the last elements are discarded. Otherwise, they are filled with 0/
null/false.- Specified by:
sizein interfaceBigList<Short>- Overrides:
sizein classAbstractShortBigList- Parameters:
size- the new size.
-
iterator
Description copied from class:AbstractShortBigListReturns a type-specific iterator on the elements of this collection.Note 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 extendsCollection.This implementation delegates to
AbstractShortBigList.listIterator().- Specified by:
iteratorin interfaceCollection<Short>- Specified by:
iteratorin interfaceIterable<Short>- Specified by:
iteratorin interfaceShortBigList- Specified by:
iteratorin interfaceShortCollection- Specified by:
iteratorin interfaceShortIterable- Overrides:
iteratorin classAbstractShortBigList- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
listIterator
Description copied from class:AbstractShortBigListReturns a type-specific big-list iterator on this type-specific big list.Note that this specification strengthens the one given in
BigList.listIterator().This implementation delegates to
listIterator(0).- Specified by:
listIteratorin interfaceBigList<Short>- Specified by:
listIteratorin interfaceShortBigList- Overrides:
listIteratorin classAbstractShortBigList- Returns:
- a big-list iterator over the elements in this big list.
- See Also:
BigList.listIterator()
-
listIterator
Description copied from class:AbstractShortBigListReturns a type-specific list iterator on this type-specific big list starting at a given index.Note that this specification strengthens the one given in
BigList.listIterator(long).This implementation is based on the random-access methods.
- Specified by:
listIteratorin interfaceBigList<Short>- Specified by:
listIteratorin interfaceShortBigList- Overrides:
listIteratorin classAbstractShortBigList- Parameters:
index- index of first element to be returned from the big-list iterator.- Returns:
- a big-list iterator of the elements in this big list, starting at the specified position in this big list.
- See Also:
BigList.listIterator(long)
-
addAll
Description copied from class:AbstractShortBigListAdds all of the elements in the specified collection to this list (optional operation).- Specified by:
addAllin interfaceBigList<Short>- Overrides:
addAllin classAbstractShortBigList- Parameters:
index- index at which to insert the first element from the specified collection.c- collection containing elements to be added to this big list.- Returns:
trueif this big list changed as a result of the call- See Also:
List.addAll(int, Collection)
-
subList
Description copied from interface:ShortBigListReturns a type-specific view of the portion of this type-specific big list from the indexfrom, inclusive, to the indexto, exclusive.Note that this specification strengthens the one given in
BigList.subList(long,long).- Specified by:
subListin interfaceBigList<Short>- Specified by:
subListin interfaceShortBigList- Overrides:
subListin classAbstractShortBigList- Parameters:
from- the starting element (inclusive).to- the ending element (exclusive).- Returns:
- a big sublist view of this big list.
- See Also:
BigList.subList(long,long)
-
contains
public boolean contains(short key)Description copied from class:AbstractShortBigListReturns true if this list contains the specified element.This implementation delegates to
indexOf().- Specified by:
containsin interfaceShortCollection- Overrides:
containsin classAbstractShortBigList- See Also:
Collection.contains(Object)
-
toShortArray
public short[] toShortArray()Description copied from interface:ShortCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toShortArrayin interfaceShortCollection- Overrides:
toShortArrayin classAbstractShortCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
Collection.toArray()
-
removeElements
public void removeElements(long from, long to)Description copied from class:AbstractShortBigListRemoves (hopefully quickly) elements of this type-specific big list.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
removeElementsin interfaceShortBigList- Overrides:
removeElementsin classAbstractShortBigList- Parameters:
from- the start index (inclusive).to- the end index (exclusive).
-
toShortArray
Deprecated.Description copied from class:AbstractShortCollectionReturns a primitive type array containing the items of this collection.Note that, contrarily to
Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.- Specified by:
toShortArrayin interfaceShortCollection- Overrides:
toShortArrayin classAbstractShortCollection- Parameters:
a- if this array is big enough, it will be used to store this collection.- Returns:
- a primitive type array containing the items of this collection.
- See Also:
Collection.toArray(Object[])
-
addAll
Description copied from class:AbstractShortBigListInserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).This implementation delegates to the type-specific version of
AbstractShortBigList.addAll(long, Collection).- Specified by:
addAllin interfaceShortBigList- Overrides:
addAllin classAbstractShortBigList- See Also:
List.addAll(int,java.util.Collection)
-
addAll
Description copied from class:AbstractShortBigListAdds all elements of the given type-specific collection to this collection.This implementation delegates to the type-specific version of
AbstractShortBigList.addAll(long, Collection).- Specified by:
addAllin interfaceShortCollection- Overrides:
addAllin classAbstractShortBigList- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.addAll(Collection)
-
addAll
Description copied from class:AbstractShortBigListInserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).This implementation delegates to the type-specific version of
AbstractShortBigList.addAll(long, Collection).- Specified by:
addAllin interfaceShortBigList- Overrides:
addAllin classAbstractShortBigList- See Also:
List.addAll(int,java.util.Collection)
-
addAll
Description copied from class:AbstractShortBigListAppends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).This implementation delegates to the type-specific list version of
AbstractShortBigList.addAll(long, Collection).- Specified by:
addAllin interfaceShortBigList- Overrides:
addAllin classAbstractShortBigList- See Also:
List.addAll(int,java.util.Collection)
-
containsAll
Description copied from interface:ShortCollectionChecks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAllin interfaceShortCollection- Overrides:
containsAllin classAbstractShortCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection contains all elements of the argument.- See Also:
Collection.containsAll(Collection)
-
removeAll
Description copied from interface:ShortCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceShortCollection- Overrides:
removeAllin classAbstractShortCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.removeAll(Collection)
-
retainAll
Description copied from interface:ShortCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceShortCollection- Overrides:
retainAllin classAbstractShortCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.retainAll(Collection)
-
add
public void add(long index, short key)Description copied from class:AbstractShortBigListInserts the specified element at the specified position in this type-specific big list (optional operation).This implementation always throws an
UnsupportedOperationException.- Specified by:
addin interfaceShortBigList- Overrides:
addin classAbstractShortBigList- See Also:
BigList.add(long,Object)
-
add
public boolean add(short key)Description copied from class:AbstractShortBigListEnsures that this collection contains the specified element (optional operation).This implementation always throws an
UnsupportedOperationException.This implementation delegates to the type-specific version of
BigList.add(long, Object).- Specified by:
addin interfaceShortCollection- Overrides:
addin classAbstractShortBigList- See Also:
Collection.add(Object)
-
getShort
public short getShort(long index)Description copied from interface:ShortBigListReturns the element at the specified position.- Specified by:
getShortin interfaceShortBigList- See Also:
BigList.get(long)
-
indexOf
public long indexOf(short k)Description copied from interface:ShortBigListReturns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.- Specified by:
indexOfin interfaceShortBigList- Overrides:
indexOfin classAbstractShortBigList- See Also:
BigList.indexOf(Object)
-
lastIndexOf
public long lastIndexOf(short k)Description copied from interface:ShortBigListReturns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.- Specified by:
lastIndexOfin interfaceShortBigList- Overrides:
lastIndexOfin classAbstractShortBigList- See Also:
BigList.lastIndexOf(Object)
-
removeShort
public short removeShort(long index)Description copied from class:AbstractShortBigListRemoves the element at the specified position.This implementation always throws an
UnsupportedOperationException.- Specified by:
removeShortin interfaceShortBigList- Overrides:
removeShortin classAbstractShortBigList- See Also:
BigList.remove(long)
-
set
public short set(long index, short k)Description copied from class:AbstractShortBigListReplaces the element at the specified position in this big list with the specified element (optional operation).This implementation always throws an
UnsupportedOperationException.- Specified by:
setin interfaceShortBigList- Overrides:
setin classAbstractShortBigList- See Also:
BigList.set(long,Object)
-
isEmpty
public boolean isEmpty()Description copied from interface:StackChecks whether the stack is empty.- Specified by:
isEmptyin interfaceCollection<Short>- Specified by:
isEmptyin interfaceStack<Short>- Overrides:
isEmptyin classAbstractCollection<Short>- Returns:
- true if the stack is empty.
-
toArray
public <T> T[] toArray(T[] a)- Specified by:
toArrayin interfaceCollection<Short>- Overrides:
toArrayin classAbstractCollection<Short>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Short>- Overrides:
containsAllin classAbstractCollection<Short>
-
addAll
Description copied from class:AbstractShortBigListThis implementation delegates to the type-specific version of
BigList.addAll(long, Collection).- Specified by:
addAllin interfaceCollection<Short>- Overrides:
addAllin classAbstractShortBigList
-
removeAll
- Specified by:
removeAllin interfaceCollection<Short>- Overrides:
removeAllin classAbstractCollection<Short>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Short>- Overrides:
retainAllin classAbstractCollection<Short>
-
clear
public void clear()Description copied from class:AbstractShortBigListThis implementation delegates to
AbstractShortBigList.removeElements(long, long).- Specified by:
clearin interfaceCollection<Short>- Overrides:
clearin classAbstractShortBigList
-
hashCode
public int hashCode()Description copied from class:AbstractShortBigListReturns the hash code for this big list, which is identical toList.hashCode().- Specified by:
hashCodein interfaceCollection<Short>- Overrides:
hashCodein classAbstractShortBigList- Returns:
- the hash code for this big list.
-