Class ObjectBigLists.SynchronizedBigList<K>
java.lang.Object
it.unimi.dsi.fastutil.objects.ObjectBigLists.SynchronizedBigList<K>
- All Implemented Interfaces:
BigList<K>,ObjectBigList<K>,ObjectCollection<K>,ObjectIterable<K>,Size64,Serializable,Comparable<BigList<? extends K>>,Iterable<K>,Collection<K>
- Enclosing class:
ObjectBigLists
public static class ObjectBigLists.SynchronizedBigList<K>
extends Object
implements ObjectBigList<K>, Serializable
A synchronized wrapper class for big lists.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidInserts the specified element at the specified position in this big list (optional operation).booleanbooleanaddAll(long index, Collection<? extends K> c) Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).booleanaddAll(Collection<? extends K> c) 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.voidclear()intbooleanbooleancontainsAll(Collection<?> c) booleanvoidget(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.booleanisEmpty()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.booleanbooleanremoveAll(Collection<?> c) voidremoveElements(long from, long to) Removes (hopefully quickly) elements of this type-specific big list.booleanbooleanretainAll(Collection<?> c) Replaces the element at the specified position in this big list with the specified element (optional operation).intsize()voidsize(long size) Deprecated.longsize64()Returns the size of this data structure as a long.Returns a type-specific spliterator on the elements of this collection.stream()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()<T> T[]toArray(T[] a) toString()Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, stream, toArray, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.objects.ObjectBigList
addAll, addAll, addAll, addAll, getElements, setElements, setElements, setElements, spliterator
-
Method Details
-
get
-
set
Description copied from interface:BigListReplaces the element at the specified position in this big list with the specified element (optional operation). -
add
-
remove
-
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). -
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
Deprecated.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
-
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>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
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:
-
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:
-
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. -
equals
- Specified by:
equalsin interfaceCollection<K>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<K>
-
compareTo
- Specified by:
compareToin interfaceComparable<K>
-
add
- Specified by:
addin interfaceCollection<K>
-
contains
- Specified by:
containsin interfaceCollection<K>
-
remove
- Specified by:
removein interfaceCollection<K>
-
size
public int size()- Specified by:
sizein interfaceCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<K>
-
toArray
- Specified by:
toArrayin interfaceCollection<K>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<K>
-
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 interfaceObjectCollection<K>- Specified by:
spliteratorin interfaceObjectIterable<K>- Returns:
- a type-specific spliterator on the elements of this collection.
-
stream
- Specified by:
streamin interfaceCollection<K>
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<K>
-
forEach
-
addAll
- Specified by:
addAllin interfaceCollection<K>
-
containsAll
- Specified by:
containsAllin interfaceCollection<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<K>
-
retainAll
- Specified by:
retainAllin interfaceCollection<K>
-
removeIf
- Specified by:
removeIfin interfaceCollection<K>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<K>
-
toString
-