Package it.unimi.dsi.fastutil.objects
Class ReferenceBigLists.Singleton<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceBigList<K>
it.unimi.dsi.fastutil.objects.ReferenceBigLists.Singleton<K>
- All Implemented Interfaces:
BigList<K>
,ObjectIterable<K>
,ReferenceBigList<K>
,ReferenceCollection<K>
,Size64
,Stack<K>
,Serializable
,Cloneable
,Iterable<K>
,Collection<K>
- Enclosing class:
ReferenceBigLists
public static class ReferenceBigLists.Singleton<K>
extends AbstractReferenceBigList<K>
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.objects.AbstractReferenceBigList
AbstractReferenceBigList.ReferenceRandomAccessSubList<K>, AbstractReferenceBigList.ReferenceSubList<K>
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addAll
(long i, Collection<? extends K> c) Adds all of the elements in the specified collection to this list (optional operation).boolean
addAll
(Collection<? extends K> c) void
clear()
clone()
boolean
Returns true if this list contains the specified element.get
(long i) Returns the element at the specified position.long
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.Returns a type-specific big-list iterator on this type-specific big list.listIterator
(long i) Returns a type-specific list iterator on this type-specific big list starting at a given index.remove
(long i) Removes the element at the specified position.boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) long
size64()
Returns the size of this data structure as a long.Returns 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.Object[]
toArray()
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceBigList
add, add, addElements, addElements, equals, forEach, getElements, hashCode, iterator, lastIndexOf, peek, pop, push, removeElements, set, setElements, size, size, top, toString
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toArray
Methods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, removeIf, stream, toArray, toArray
Methods inherited from interface it.unimi.dsi.fastutil.objects.ReferenceBigList
addAll, addAll, addAll, addAll, getElements, setElements, setElements
-
Method Details
-
get
Description copied from interface:BigList
Returns the element at the specified position. -
remove
- Specified by:
remove
in interfaceCollection<K>
- Overrides:
remove
in classAbstractCollection<K>
-
remove
Description copied from class:AbstractReferenceBigList
Removes the element at the specified position. -
contains
Description copied from class:AbstractReferenceBigList
Returns true if this list contains the specified element.- Specified by:
contains
in interfaceCollection<K>
- Overrides:
contains
in classAbstractReferenceBigList<K>
- See Also:
-
indexOf
Description copied from interface:BigList
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. -
toArray
- Specified by:
toArray
in interfaceCollection<K>
- Overrides:
toArray
in classAbstractCollection<K>
-
listIterator
Description copied from class:AbstractReferenceBigList
Returns a type-specific big-list iterator on this type-specific big list.- Specified by:
listIterator
in interfaceBigList<K>
- Specified by:
listIterator
in interfaceReferenceBigList<K>
- Overrides:
listIterator
in classAbstractReferenceBigList<K>
- Returns:
- a big-list iterator over the elements in this big list.
- See Also:
-
listIterator
Description copied from class:AbstractReferenceBigList
Returns a type-specific list iterator on this type-specific big list starting at a given index.- Specified by:
listIterator
in interfaceBigList<K>
- Specified by:
listIterator
in interfaceReferenceBigList<K>
- Overrides:
listIterator
in classAbstractReferenceBigList<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:
-
spliterator
Description copied from interface:ReferenceBigList
Returns a type-specific spliterator on the elements of this big-list.BigList spliterators must report at least
Spliterator.SIZED
andSpliterator.ORDERED
.See
List.spliterator()
for more documentation on the requirements of the returned spliterator (despiteBigList
not being aList
, most of the same requirements apply.- Specified by:
spliterator
in interfaceCollection<K>
- Specified by:
spliterator
in interfaceIterable<K>
- Specified by:
spliterator
in interfaceObjectIterable<K>
- Specified by:
spliterator
in interfaceReferenceBigList<K>
- Specified by:
spliterator
in interfaceReferenceCollection<K>
- Returns:
- a type-specific spliterator on the elements of this collection.
-
subList
Description copied from interface:ReferenceBigList
Returns a type-specific view of the portion of this type-specific big list from the indexfrom
, inclusive, to the indexto
, exclusive.- Specified by:
subList
in interfaceBigList<K>
- Specified by:
subList
in interfaceReferenceBigList<K>
- Overrides:
subList
in classAbstractReferenceBigList<K>
- Parameters:
from
- the starting element (inclusive).to
- the ending element (exclusive).- Returns:
- a big sublist view of this big list.
- See Also:
-
addAll
Description copied from class:AbstractReferenceBigList
Adds all of the elements in the specified collection to this list (optional operation).- Specified by:
addAll
in interfaceBigList<K>
- Overrides:
addAll
in classAbstractReferenceBigList<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:
true
if this big list changed as a result of the call- See Also:
-
addAll
Description copied from class:AbstractReferenceBigList
- Specified by:
addAll
in interfaceCollection<K>
- Overrides:
addAll
in classAbstractReferenceBigList<K>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K>
- Overrides:
removeAll
in classAbstractCollection<K>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K>
- Overrides:
retainAll
in classAbstractCollection<K>
-
clear
public void clear()Description copied from class:AbstractReferenceBigList
- Specified by:
clear
in interfaceCollection<K>
- Overrides:
clear
in classAbstractReferenceBigList<K>
-
size64
public long size64()Description copied from interface:Size64
Returns the size of this data structure as a long. -
clone
-