Package it.unimi.dsi.fastutil.objects
Class ObjectBigLists.Singleton<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectBigList<K>
it.unimi.dsi.fastutil.objects.ObjectBigLists.Singleton<K>
- All Implemented Interfaces:
BigList<K>,ObjectBigList<K>,ObjectCollection<K>,ObjectIterable<K>,Size64,Stack<K>,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<BigList<? extends K>>,java.lang.Iterable<K>,java.util.Collection<K>
- Enclosing class:
- ObjectBigLists
public static class ObjectBigLists.Singleton<K> extends AbstractObjectBigList<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.AbstractObjectBigList
AbstractObjectBigList.ObjectRandomAccessSubList<K>, AbstractObjectBigList.ObjectSubList<K> -
Method Summary
Modifier and Type Method Description booleanaddAll(long i, java.util.Collection<? extends K> c)Adds all of the elements in the specified collection to this list (optional operation).booleanaddAll(java.util.Collection<? extends K> c)voidclear()java.lang.Objectclone()booleancontains(java.lang.Object k)Returns true if this list contains the specified element.Kget(long i)Returns the element at the specified position.longindexOf(java.lang.Object k)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.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(java.lang.Object k)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)longsize64()Returns the size of this data structure as a long.ObjectSpliterator<K>spliterator()Returns a type-specific spliterator on the elements of this big-list.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.java.lang.Object[]toArray()Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectBigList
add, add, addElements, addElements, compareTo, equals, forEach, getElements, hashCode, iterator, lastIndexOf, peek, pop, push, removeElements, set, setElements, size, size, top, toStringMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toArrayMethods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, removeIf, stream, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.objects.ObjectBigList
addAll, addAll, addAll, addAll, setElements, setElements
-
Method Details
-
get
Description copied from interface:BigListReturns the element at the specified position. -
remove
public boolean remove(java.lang.Object k) -
remove
Description copied from class:AbstractObjectBigListRemoves the element at the specified position. -
contains
public boolean contains(java.lang.Object k)Description copied from class:AbstractObjectBigListReturns true if this list contains the specified element.- Specified by:
containsin interfacejava.util.Collection<K>- Overrides:
containsin classAbstractObjectBigList<K>- See Also:
Collection.contains(Object)
-
indexOf
public long indexOf(java.lang.Object k)Description copied from interface:BigListReturns 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.- Specified by:
indexOfin interfaceBigList<K>- Overrides:
indexOfin classAbstractObjectBigList<K>- Parameters:
k- the object to search for.- 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.
- See Also:
List.indexOf(Object)
-
toArray
public java.lang.Object[] toArray() -
listIterator
Description copied from class:AbstractObjectBigListReturns a type-specific big-list iterator on this type-specific big list.- 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.- 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)
-
spliterator
Description copied from interface:ObjectBigListReturns 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 interfacejava.util.Collection<K>- Specified by:
spliteratorin interfacejava.lang.Iterable<K>- Specified by:
spliteratorin interfaceObjectBigList<K>- Specified by:
spliteratorin interfaceObjectCollection<K>- Specified by:
spliteratorin interfaceObjectIterable<K>- Returns:
- a type-specific spliterator on the elements of this collection.
-
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.- 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:AbstractObjectBigList- Specified by:
addAllin interfacejava.util.Collection<K>- Overrides:
addAllin classAbstractObjectBigList<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:AbstractObjectBigList- Specified by:
clearin interfacejava.util.Collection<K>- Overrides:
clearin classAbstractObjectBigList<K>
-
size64
public long size64()Description copied from interface:Size64Returns the size of this data structure as a long. -
clone
public java.lang.Object clone()
-