it.unimi.dsi.fastutil.bytes
Class ByteBigLists

java.lang.Object
  extended by it.unimi.dsi.fastutil.bytes.ByteBigLists

public class ByteBigLists
extends Object

A class providing static methods and objects that do useful things with type-specific big lists.

See Also:
Collections, BigList

Nested Class Summary
static class ByteBigLists.EmptyBigList
          An immutable class representing an empty type-specific big list.
static class ByteBigLists.ListBigList
          A class exposing a list as a big list.
static class ByteBigLists.Singleton
          An immutable class representing a type-specific singleton big list.
static class ByteBigLists.SynchronizedBigList
          A synchronized wrapper class for big lists.
static class ByteBigLists.UnmodifiableBigList
          An unmodifiable wrapper class for big lists.
 
Field Summary
static ByteBigLists.EmptyBigList EMPTY_BIG_LIST
          An empty big list (immutable).
 
Method Summary
static ByteBigList asBigList(ByteList list)
          Returns a big list backed by the specified list.
static ByteBigList shuffle(ByteBigList l, Random random)
          Shuffles the specified big list using the specified pseudorandom number generator.
static ByteBigList singleton(byte element)
          Returns a type-specific immutable big list containing only the specified element.
static ByteBigList singleton(Object element)
          Returns a type-specific immutable big list containing only the specified element.
static ByteBigList synchronize(ByteBigList l)
          Returns a synchronized type-specific big list backed by the given type-specific big list.
static ByteBigList synchronize(ByteBigList l, Object sync)
          Returns a synchronized type-specific big list backed by the given type-specific big list, using an assigned object to synchronize.
static ByteBigList unmodifiable(ByteBigList 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 Detail

EMPTY_BIG_LIST

public static final ByteBigLists.EmptyBigList EMPTY_BIG_LIST
An empty big list (immutable). It is serializable and cloneable.

The class of this objects represent an abstract empty list that is a sublist of any type of list. Thus, EMPTY_BIG_LIST may be assigned to a variable of any (sorted) type-specific list.

Method Detail

shuffle

public static ByteBigList shuffle(ByteBigList l,
                                  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 (please use a XorShift* generator).
Returns:
l.

singleton

public static ByteBigList singleton(byte 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.

singleton

public static ByteBigList singleton(Object 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 ByteBigList synchronize(ByteBigList 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 ByteBigList synchronize(ByteBigList l,
                                      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 ByteBigList unmodifiable(ByteBigList 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 ByteBigList asBigList(ByteList list)
Returns a big list backed by the specified list.

Parameters:
list - a list.
Returns:
a big list backed by the specified list.