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>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<K>
,java.util.Collection<K>
- Enclosing class:
- ReferenceBigLists
public static class ReferenceBigLists.Singleton<K> extends AbstractReferenceBigList<K> implements java.io.Serializable, java.lang.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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceBigList
AbstractReferenceBigList.ReferenceSubList<K>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAll(long i, java.util.Collection<? extends K> c)
Adds all of the elements in the specified collection to this list (optional operation).boolean
addAll(java.util.Collection<? extends K> c)
void
clear()
java.lang.Object
clone()
boolean
contains(java.lang.Object k)
Returns true if this list contains the specified element.K
get(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.K
remove(long i)
Removes the element at the specified position.boolean
remove(java.lang.Object k)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
long
size64()
Returns the size of this data structure as a long.ReferenceBigList<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.java.lang.Object[]
toArray()
-
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceBigList
add, add, addElements, addElements, equals, getElements, hashCode, indexOf, iterator, lastIndexOf, peek, pop, push, removeElements, set, size, size, top, toString
-
-
-
-
Method Detail
-
get
public K get(long i)
Description copied from interface:BigList
Returns the element at the specified position.
-
remove
public boolean remove(java.lang.Object k)
-
remove
public K remove(long i)
Description copied from class:AbstractReferenceBigList
Removes the element at the specified position.This implementation always throws an
UnsupportedOperationException
.
-
contains
public boolean contains(java.lang.Object k)
Description copied from class:AbstractReferenceBigList
Returns true if this list contains the specified element.This implementation delegates to
indexOf()
.- Specified by:
contains
in interfacejava.util.Collection<K>
- Overrides:
contains
in classAbstractReferenceBigList<K>
- See Also:
Collection.contains(Object)
-
toArray
public java.lang.Object[] toArray()
-
listIterator
public ObjectBigListIterator<K> listIterator()
Description copied from class:AbstractReferenceBigList
Returns 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:
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:
BigList.listIterator()
-
listIterator
public ObjectBigListIterator<K> listIterator(long i)
Description copied from class:AbstractReferenceBigList
Returns 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:
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:
BigList.listIterator(long)
-
subList
public ReferenceBigList<K> subList(long from, long to)
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.Note that this specification strengthens the one given in
BigList.subList(long,long)
.- 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:
BigList.subList(long,long)
-
addAll
public boolean addAll(long i, java.util.Collection<? extends K> c)
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:
List.addAll(int, Collection)
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
Description copied from class:AbstractReferenceBigList
This implementation delegates to the type-specific version of
BigList.addAll(long, Collection)
.- Specified by:
addAll
in interfacejava.util.Collection<K>
- Overrides:
addAll
in classAbstractReferenceBigList<K>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
clear
public void clear()
Description copied from class:AbstractReferenceBigList
This implementation delegates to
AbstractReferenceBigList.removeElements(long, long)
.- Specified by:
clear
in interfacejava.util.Collection<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
public java.lang.Object clone()
-
-