Package it.unimi.dsi.fastutil.objects
Class ObjectBigLists.EmptyBigList<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectCollection<K>
it.unimi.dsi.fastutil.objects.ObjectCollections.EmptyCollection<K>
it.unimi.dsi.fastutil.objects.ObjectBigLists.EmptyBigList<K>
- All Implemented Interfaces:
BigList<K>,ObjectBigList<K>,ObjectCollection<K>,ObjectIterable<K>,Size64,Serializable,Cloneable,Comparable<BigList<? extends K>>,Iterable<K>,Collection<K>
- Enclosing class:
- ObjectBigLists
public static class ObjectBigLists.EmptyBigList<K>
extends ObjectCollections.EmptyCollection<K>
implements ObjectBigList<K>, Serializable, Cloneable
An immutable class representing an empty type-specific big list.
This class may be useful to implement your own in case you subclass a type-specific list.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidInserts the specified element at the specified position in this big list (optional operation).booleanaddAll(long i, Collection<? extends K> c) Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).voidaddElements(long index, K[][] a) Add (hopefully quickly) elements to this type-specific big list.voidaddElements(long index, K[][] a, long offset, long length) Add (hopefully quickly) elements to this type-specific big list.clone()intbooleanget(long i) Returns the element at the specified position.voidgetElements(long from, Object[][] a, long offset, long length) Copies (hopefully quickly) elements of this type-specific big list into the given big array.inthashCode()longReturns 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.iterator()Returns a type-specific iterator on the elements of this collection.longReturns the index of the last 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.booleanvoidremoveElements(long from, long to) Removes (hopefully quickly) elements of this type-specific big list.Replaces the element at the specified position in this big list with the specified element (optional operation).voidsize(long s) Sets the size of this big list.longsize64()Returns the size of this data structure as a long.Returns a type-specific spliterator on the elements of this collection.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.toString()Methods inherited from class it.unimi.dsi.fastutil.objects.ObjectCollections.EmptyCollection
addAll, clear, contains, containsAll, forEach, removeAll, removeIf, retainAll, size, toArray, toArrayMethods inherited from class java.util.AbstractCollection
add, isEmptyMethods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, isEmpty, parallelStream, removeAll, removeIf, retainAll, stream, toArray, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.objects.ObjectBigList
addAll, addAll, addAll, addAll, getElements, setElements, setElements, setElements
-
Method Details
-
get
Description copied from interface:BigListReturns the element at the specified position. -
remove
- Specified by:
removein interfaceCollection<K>- Overrides:
removein classAbstractCollection<K>
-
remove
Description copied from interface:BigListRemoves the element at the specified position. -
add
Description copied from interface:BigListInserts the specified element at the specified position in this big list (optional operation). -
set
Description copied from interface:BigListReplaces the element at the specified position in this big list with the specified element (optional operation). -
indexOf
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. -
lastIndexOf
Description copied from interface:BigListReturns the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.- Specified by:
lastIndexOfin interfaceBigList<K>- Parameters:
k- the object to search for.- Returns:
- the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
- See Also:
-
addAll
Description copied from interface:BigListInserts all of the elements in the specified collection into this big list at the specified position (optional operation). -
listIterator
Description copied from interface:ObjectBigListReturns a type-specific big-list iterator on this type-specific big list.- Specified by:
listIteratorin interfaceBigList<K>- Specified by:
listIteratorin interfaceObjectBigList<K>- Returns:
- a big-list iterator over the elements in this big list.
- See Also:
-
iterator
Description copied from interface:ObjectCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceObjectBigList<K>- Specified by:
iteratorin interfaceObjectCollection<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Overrides:
iteratorin classObjectCollections.EmptyCollection<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
listIterator
Description copied from interface:ObjectBigListReturns 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>- 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:ObjectCollectionReturns a type-specific spliterator on the elements of this collection.See
Collection.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceCollection<K>- Specified by:
spliteratorin interfaceIterable<K>- Specified by:
spliteratorin interfaceObjectBigList<K>- Specified by:
spliteratorin interfaceObjectCollection<K>- Specified by:
spliteratorin interfaceObjectIterable<K>- Overrides:
spliteratorin classObjectCollections.EmptyCollection<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. -
getElements
Description copied from interface:ObjectBigListCopies (hopefully quickly) elements of this type-specific big list into the given big array.- Specified by:
getElementsin interfaceObjectBigList<K>- Parameters:
from- the start index (inclusive).a- the destination big array.offset- the offset into the destination big array where to store the first element copied.length- the number of elements to be copied.
-
removeElements
public void removeElements(long from, long to) Description copied from interface:ObjectBigListRemoves (hopefully quickly) elements of this type-specific big list.- Specified by:
removeElementsin interfaceObjectBigList<K>- Parameters:
from- the start index (inclusive).to- the end index (exclusive).
-
addElements
Description copied from interface:ObjectBigListAdd (hopefully quickly) elements to this type-specific big list.- Specified by:
addElementsin interfaceObjectBigList<K>- Parameters:
index- the index at which to add elements.a- the big array containing the elements.offset- the offset of the first element to add.length- the number of elements to add.
-
addElements
Description copied from interface:ObjectBigListAdd (hopefully quickly) elements to this type-specific big list.- Specified by:
addElementsin interfaceObjectBigList<K>- Parameters:
index- the index at which to add elements.a- the big array containing the elements.
-
size
public void size(long s) Description copied from interface:BigListSets the size of this big list.If the specified size is smaller than the current size, the last elements are discarded. Otherwise, they are filled with 0/
null/false. -
size64
public long size64()Description copied from interface:Size64Returns the size of this data structure as a long. -
compareTo
- Specified by:
compareToin interfaceComparable<K>
-
clone
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<K>- Overrides:
hashCodein classObjectCollections.EmptyCollection<K>
-
equals
- Specified by:
equalsin interfaceCollection<K>- Overrides:
equalsin classObjectCollections.EmptyCollection<K>
-
toString
- Overrides:
toStringin classAbstractObjectCollection<K>
-