Package it.unimi.dsi.fastutil.shorts
Class ShortBigLists.Singleton
java.lang.Object
java.util.AbstractCollection<Short>
it.unimi.dsi.fastutil.shorts.AbstractShortCollection
it.unimi.dsi.fastutil.shorts.AbstractShortBigList
it.unimi.dsi.fastutil.shorts.ShortBigLists.Singleton
- All Implemented Interfaces:
it.unimi.dsi.fastutil.BigList<Short>,ShortBigList,it.unimi.dsi.fastutil.shorts.ShortCollection,it.unimi.dsi.fastutil.shorts.ShortIterable,it.unimi.dsi.fastutil.shorts.ShortStack,it.unimi.dsi.fastutil.Size64,it.unimi.dsi.fastutil.Stack<Short>,Serializable,Cloneable,Comparable<it.unimi.dsi.fastutil.BigList<? extends Short>>,Iterable<Short>,Collection<Short>
- Enclosing class:
ShortBigLists
public static class ShortBigLists.Singleton
extends AbstractShortBigList
implements Serializable, Cloneable
An immutable class representing a type-specific singleton big list.
This class may be useful to implement your own in case you subclass a type-specific big list.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortBigList
AbstractShortBigList.ShortRandomAccessSubList, AbstractShortBigList.ShortSubList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(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, it.unimi.dsi.fastutil.shorts.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).booleanAppends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).booleanaddAll(it.unimi.dsi.fastutil.shorts.ShortCollection c) booleanaddAll(Collection<? extends Short> c) voidclear()clone()booleancontains(short k) Returns true if this list contains the specified element.shortgetShort(long i) Returns the element at the specified position.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.it.unimi.dsi.fastutil.shorts.ShortBigListIteratorReturns a type-specific big-list iterator on this type-specific big list.it.unimi.dsi.fastutil.shorts.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(it.unimi.dsi.fastutil.shorts.ShortCollection c) booleanremoveAll(Collection<?> c) shortremoveShort(long i) Removes the element at the specified position.booleanretainAll(it.unimi.dsi.fastutil.shorts.ShortCollection c) booleanretainAll(Collection<?> c) longsize64()it.unimi.dsi.fastutil.shorts.ShortSpliteratorReturns a type-specific spliterator on the elements of this big-list.subList(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[]Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortBigList
add, add, add, addElements, addElements, compareTo, ensureIndex, ensureRestrictedIndex, equals, forEach, get, getElements, hashCode, indexOf, intSpliterator, iterator, lastIndexOf, lastIndexOf, peek, peekShort, pop, popShort, push, push, remove, removeElements, set, set, setElements, size, size, top, topShort, toStringMethods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
add, contains, containsAll, containsAll, remove, toArray, toShortArrayMethods inherited from class java.util.AbstractCollection
isEmpty, toArray, toArrayMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
containsAll, isEmpty, toArray, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.shorts.ShortBigList
addAll, addAll, getElements, setElements, setElementsMethods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
add, contains, containsAll, intIterator, intParallelStream, intStream, parallelStream, remove, removeIf, removeIf, removeIf, stream, toArray, toShortArrayMethods inherited from interface it.unimi.dsi.fastutil.shorts.ShortIterable
forEach, forEachMethods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
-
Constructor Details
-
Singleton
protected Singleton(short element)
-
-
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:
-
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).- Specified by:
remin interfaceit.unimi.dsi.fastutil.shorts.ShortCollection- Overrides:
remin classAbstractShortBigList- See Also:
-
removeShort
public short removeShort(long i) Description copied from class:AbstractShortBigListRemoves the element at the specified position.- Specified by:
removeShortin interfaceShortBigList- Overrides:
removeShortin classAbstractShortBigList- See Also:
-
contains
public boolean contains(short k) Description copied from class:AbstractShortBigListReturns true if this list contains the specified element.- Specified by:
containsin interfaceit.unimi.dsi.fastutil.shorts.ShortCollection- Overrides:
containsin classAbstractShortBigList- See Also:
-
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:
-
toShortArray
public short[] toShortArray()- Specified by:
toShortArrayin interfaceit.unimi.dsi.fastutil.shorts.ShortCollection- Overrides:
toShortArrayin classit.unimi.dsi.fastutil.shorts.AbstractShortCollection
-
listIterator
public it.unimi.dsi.fastutil.shorts.ShortBigListIterator listIterator()Description copied from class:AbstractShortBigListReturns a type-specific big-list iterator on this type-specific big list.- Specified by:
listIteratorin interfaceit.unimi.dsi.fastutil.BigList<Short>- Specified by:
listIteratorin interfaceShortBigList- Overrides:
listIteratorin classAbstractShortBigList- See Also:
-
listIterator
public it.unimi.dsi.fastutil.shorts.ShortBigListIterator listIterator(long i) Description copied from class:AbstractShortBigListReturns a type-specific list iterator on this type-specific big list starting at a given index.- Specified by:
listIteratorin interfaceit.unimi.dsi.fastutil.BigList<Short>- Specified by:
listIteratorin interfaceShortBigList- Overrides:
listIteratorin classAbstractShortBigList- See Also:
-
spliterator
public it.unimi.dsi.fastutil.shorts.ShortSpliterator spliterator()Description copied from interface:ShortBigListReturns a type-specific spliterator on the elements of this big-list.BigList spliterators must report at least
Spliterator.SIZEDandSpliterator.ORDERED.See
List.spliterator()for more documentation on the requirements of the returned spliterator (despiteBigListnot being aList, most of the same requirements apply.- Specified by:
spliteratorin interfaceCollection<Short>- Specified by:
spliteratorin interfaceIterable<Short>- Specified by:
spliteratorin interfaceShortBigList- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.shorts.ShortCollection- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.shorts.ShortIterable- Returns:
-
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.- Specified by:
subListin interfaceit.unimi.dsi.fastutil.BigList<Short>- Specified by:
subListin interfaceShortBigList- Overrides:
subListin classAbstractShortBigList- See Also:
-
addAll
Description copied from class:AbstractShortBigListAdds all of the elements in the specified collection to this list (optional operation).- Specified by:
addAllin interfaceit.unimi.dsi.fastutil.BigList<Short>- Overrides:
addAllin classAbstractShortBigList
-
addAll
Description copied from class:AbstractShortBigList- Specified by:
addAllin interfaceCollection<Short>- Overrides:
addAllin classAbstractShortBigList
-
removeAll
- Specified by:
removeAllin interfaceCollection<Short>- Overrides:
removeAllin classit.unimi.dsi.fastutil.shorts.AbstractShortCollection
-
retainAll
- Specified by:
retainAllin interfaceCollection<Short>- Overrides:
retainAllin classit.unimi.dsi.fastutil.shorts.AbstractShortCollection
-
addAll
Description copied from interface:ShortBigListAppends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).- Specified by:
addAllin interfaceShortBigList- See Also:
-
addAll
Description copied from interface:ShortBigListInserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).- Specified by:
addAllin interfaceShortBigList- See Also:
-
addAll
public boolean addAll(long i, it.unimi.dsi.fastutil.shorts.ShortCollection c) 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).- Specified by:
addAllin interfaceShortBigList- Overrides:
addAllin classAbstractShortBigList- See Also:
-
addAll
public boolean addAll(it.unimi.dsi.fastutil.shorts.ShortCollection c) Description copied from class:AbstractShortBigList- Specified by:
addAllin interfaceit.unimi.dsi.fastutil.shorts.ShortCollection- Overrides:
addAllin classAbstractShortBigList
-
removeAll
public boolean removeAll(it.unimi.dsi.fastutil.shorts.ShortCollection c) - Specified by:
removeAllin interfaceit.unimi.dsi.fastutil.shorts.ShortCollection- Overrides:
removeAllin classit.unimi.dsi.fastutil.shorts.AbstractShortCollection
-
retainAll
public boolean retainAll(it.unimi.dsi.fastutil.shorts.ShortCollection c) - Specified by:
retainAllin interfaceit.unimi.dsi.fastutil.shorts.ShortCollection- Overrides:
retainAllin classit.unimi.dsi.fastutil.shorts.AbstractShortCollection
-
clear
public void clear()Description copied from class:AbstractShortBigList- Specified by:
clearin interfaceCollection<Short>- Overrides:
clearin classAbstractShortBigList
-
size64
public long size64()- Specified by:
size64in interfaceit.unimi.dsi.fastutil.Size64
-
clone
-