Class ReferenceBigLists

java.lang.Object
it.unimi.dsi.fastutil.objects.ReferenceBigLists

public final class ReferenceBigLists
extends java.lang.Object
A class providing static methods and objects that do useful things with type-specific big lists.
See Also:
Collections, BigList
  • Field Details

  • Method Details

    • shuffle

      public static <K> ReferenceBigList<K> shuffle​(ReferenceBigList<K> l, java.util.Random random)
      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

      public static <K> ReferenceBigList<K> 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

      public static <K> ReferenceBigList<K> singleton​(K element)
      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

      public static <K> ReferenceBigList<K> synchronize​(ReferenceBigList<K> l)
      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

      public static <K> ReferenceBigList<K> synchronize​(ReferenceBigList<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.
      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

      public static <K> ReferenceBigList<K> unmodifiable​(ReferenceBigList<? extends K> l)
      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

      public static <K> ReferenceBigList<K> asBigList​(ReferenceList<K> list)
      Returns a big list backed by the specified list.
      Parameters:
      list - a list.
      Returns:
      a big list backed by the specified list.