Class ObjectBigLists.Singleton<K>
- All Implemented Interfaces:
BigList<K>,ObjectBigList<K>,ObjectCollection<K>,ObjectIterable<K>,Size64,Stack<K>,Serializable,Cloneable,Comparable<BigList<? extends K>>,Iterable<K>,Collection<K>
- Enclosing class:
- ObjectBigLists
public static class ObjectBigLists.Singleton<K> extends AbstractObjectBigList<K> 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.objects.AbstractObjectBigList
AbstractObjectBigList.ObjectSubList<K> -
Method Summary
Modifier and Type Method Description booleanaddAll(long i, Collection<? extends K> c)Adds all of the elements in the specified collection to this list (optional operation).booleanaddAll(Collection<? extends K> c)voidclear()Objectclone()booleancontains(Object k)Returns true if this list contains the specified element.Kget(long i)Returns the element at the specified position.ObjectBigListIterator<K>listIterator()Returns a type-specific big-list iterator on this type-specific big list.ObjectBigListIterator<K>listIterator(long i)Returns a type-specific list iterator on this type-specific big list starting at a given index.Kremove(long i)Removes the element at the specified position.booleanremove(Object k)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)longsize64()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 indexfrom, inclusive, to the indexto, exclusive.Object[]toArray()Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectBigList
add, add, addElements, addElements, compareTo, equals, getElements, hashCode, indexOf, iterator, lastIndexOf, peek, pop, push, removeElements, set, size, size, top, toStringMethods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, removeIf, spliterator, stream, toArray, toArray
-
Method Details
-
get
Description copied from interface:BigListReturns the element at the specified position.- Specified by:
getin interfaceBigList<K>- Parameters:
i- a position in the big list.- Returns:
- the element at the specified position.
- See Also:
List.get(int)
-
remove
- Specified by:
removein interfaceCollection<K>- Overrides:
removein classAbstractCollection<K>
-
remove
Description copied from class:AbstractObjectBigListRemoves the element at the specified position.This implementation always throws an
UnsupportedOperationException.- Specified by:
removein interfaceBigList<K>- Overrides:
removein classAbstractObjectBigList<K>- Parameters:
i- a position in the big list.- Returns:
- the element previously at the specified position.
- See Also:
List.remove(int)
-
contains
Description copied from class:AbstractObjectBigListReturns true if this list contains the specified element.This implementation delegates to
indexOf().- Specified by:
containsin interfaceCollection<K>- Overrides:
containsin classAbstractObjectBigList<K>- See Also:
Collection.contains(Object)
-
toArray
- Specified by:
toArrayin interfaceCollection<K>- Overrides:
toArrayin classAbstractCollection<K>
-
listIterator
Description copied from class:AbstractObjectBigListReturns 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<K>- Specified by:
listIteratorin interfaceObjectBigList<K>- Overrides:
listIteratorin classAbstractObjectBigList<K>- Returns:
- a big-list iterator over the elements in this big list.
- See Also:
BigList.listIterator()
-
listIterator
Description copied from class:AbstractObjectBigListReturns 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<K>- Specified by:
listIteratorin interfaceObjectBigList<K>- Overrides:
listIteratorin classAbstractObjectBigList<K>- 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:ObjectBigListReturns 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<K>- Specified by:
subListin interfaceObjectBigList<K>- Overrides:
subListin classAbstractObjectBigList<K>- 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:AbstractObjectBigListAdds all of the elements in the specified collection to this list (optional operation).- Specified by:
addAllin interfaceBigList<K>- Overrides:
addAllin classAbstractObjectBigList<K>- 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:AbstractObjectBigListThis implementation delegates to the type-specific version of
BigList.addAll(long, Collection).- Specified by:
addAllin interfaceCollection<K>- Overrides:
addAllin classAbstractObjectBigList<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<K>- Overrides:
removeAllin classAbstractCollection<K>
-
retainAll
- Specified by:
retainAllin interfaceCollection<K>- Overrides:
retainAllin classAbstractCollection<K>
-
clear
public void clear()Description copied from class:AbstractObjectBigListThis implementation delegates to
AbstractObjectBigList.removeElements(long, long).- Specified by:
clearin interfaceCollection<K>- Overrides:
clearin classAbstractObjectBigList<K>
-
size64
public long size64()Description copied from interface:Size64Returns the size of this data structure as a long. -
clone
-