Class ShortBigLists.Singleton
- All Implemented Interfaces:
BigList<Short>,ShortBigList,ShortCollection,ShortIterable,ShortStack,Size64,Stack<Short>,Serializable,Cloneable,Comparable<BigList<? extends Short>>,Iterable<Short>,Collection<Short>
- Enclosing class:
- ShortBigLists
public static class ShortBigLists.Singleton extends AbstractShortBigList implements Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific big list.
- 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 booleanaddAll(long i, 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 i, 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 i, 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()Objectclone()booleancontains(short k)Returns true if this list contains the specified element.shortgetShort(long i)Returns the element at the specified position.ShortBigListIteratorlistIterator()Returns a type-specific big-list iterator on this type-specific big list.ShortBigListIteratorlistIterator(long i)Returns a type-specific list iterator on this type-specific big list starting at a given index.booleanrem(short k)Removes a single instance of the specified element from this collection, if it is present (optional operation).booleanremoveAll(ShortCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c)shortremoveShort(long i)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)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.short[]toShortArray()Returns a primitive type array containing the items of this collection.Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortBigList
add, add, add, addElements, addElements, compareTo, equals, get, getElements, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, peek, peekShort, pop, popShort, push, push, remove, removeElements, set, set, size, size, top, topShort, toStringMethods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
add, contains, containsAll, remove, toArray, toShortArrayMethods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
add, contains, containsAll, remove, removeIf, removeIf, toArray, toShortArray
-
Method Details
-
getShort
public short getShort(long i)Description copied from interface:ShortBigListReturns the element at the specified position.- Specified by:
getShortin interfaceShortBigList- See Also:
BigList.get(long)
-
rem
public boolean rem(short k)Description copied from class:AbstractShortBigListRemoves a single instance of the specified element from this collection, if it is present (optional operation).This implementation delegates to
indexOf().- Specified by:
remin interfaceShortCollection- Overrides:
remin classAbstractShortBigList- See Also:
Collection.remove(Object)
-
removeShort
public short removeShort(long i)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)
-
contains
public boolean contains(short k)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()
-
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:
i- 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)
-
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)
-
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:
i- 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)
-
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>
-
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)
-
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: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)
-
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)
-
clear
public void clear()Description copied from class:AbstractShortBigListThis implementation delegates to
AbstractShortBigList.removeElements(long, long).- Specified by:
clearin interfaceCollection<Short>- Overrides:
clearin classAbstractShortBigList
-
size64
public long size64()Description copied from interface:Size64Returns the size of this data structure as a long. -
clone
-