Package it.unimi.dsi.fastutil.objects
Class ObjectBigLists
java.lang.Object
it.unimi.dsi.fastutil.objects.ObjectBigLists
public final class ObjectBigLists
extends java.lang.Object
A class providing static methods and objects that do useful things with type-specific big lists.
- See Also:
Collections,BigList
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObjectBigLists.EmptyBigList<K>An immutable class representing an empty type-specific big list.static classObjectBigLists.ListBigList<K>A class exposing a list as a big list.static classObjectBigLists.Singleton<K>An immutable class representing a type-specific singleton big list.static classObjectBigLists.SynchronizedBigList<K>A synchronized wrapper class for big lists.static classObjectBigLists.UnmodifiableBigList<K>An unmodifiable wrapper class for big lists. -
Field Summary
Fields Modifier and Type Field Description static ObjectBigLists.EmptyBigListEMPTY_BIG_LISTAn empty big list (immutable). -
Method Summary
Modifier and Type Method Description static <K> ObjectBigList<K>asBigList(ObjectList<K> list)Returns a big list backed by the specified list.static <K> ObjectBigList<K>emptyList()Returns an empty big list (immutable).static <K> ObjectBigList<K>shuffle(ObjectBigList<K> l, java.util.Random random)Shuffles the specified big list using the specified pseudorandom number generator.static <K> ObjectBigList<K>singleton(K element)Returns a type-specific immutable big list containing only the specified element.static <K> ObjectBigList<K>synchronize(ObjectBigList<K> l)Returns a synchronized type-specific big list backed by the given type-specific big list.static <K> ObjectBigList<K>synchronize(ObjectBigList<K> l, java.lang.Object sync)Returns a synchronized type-specific big list backed by the given type-specific big list, using an assigned object to synchronize.static <K> ObjectBigList<K>unmodifiable(ObjectBigList<? extends K> l)Returns an unmodifiable type-specific big list backed by the given type-specific big list.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
EMPTY_BIG_LIST
An empty big list (immutable). It is serializable and cloneable.
-
-
Method Details
-
shuffle
Shuffles the specified big list using the specified pseudorandom number generator.- Parameters:
l- the big list to be shuffled.random- a pseudorandom number generator.- Returns:
l.
-
emptyList
Returns an empty big list (immutable). It is serializable and cloneable.This method provides a typesafe access to
EMPTY_BIG_LIST.- Returns:
- an empty big list (immutable).
-
singleton
Returns a type-specific immutable big list containing only the specified element. The returned big list is serializable and cloneable.- Parameters:
element- the only element of the returned big list.- Returns:
- a type-specific immutable big list containing just
element.
-
synchronize
Returns a synchronized type-specific big list backed by the given type-specific big list.- Parameters:
l- the big list to be wrapped in a synchronized big list.- Returns:
- a synchronized view of the specified big list.
- See Also:
Collections.synchronizedList(List)
-
synchronize
Returns a synchronized type-specific big list backed by the given type-specific big list, using an assigned object to synchronize.- Parameters:
l- the big list to be wrapped in a synchronized big list.sync- an object that will be used to synchronize the access to the big list.- Returns:
- a synchronized view of the specified big list.
- See Also:
Collections.synchronizedList(List)
-
unmodifiable
Returns an unmodifiable type-specific big list backed by the given type-specific big list.- Parameters:
l- the big list to be wrapped in an unmodifiable big list.- Returns:
- an unmodifiable view of the specified big list.
- See Also:
Collections.unmodifiableList(List)
-
asBigList
Returns a big list backed by the specified list.- Parameters:
list- a list.- Returns:
- a big list backed by the specified list.
-