public class RandSeq extends Object
Constructor and Description |
---|
RandSeq()
Creates a new RandSeq object.
|
RandSeq(long seed)
Creates a new RandSeq object.
|
RandSeq(Random generator)
Creates a new RandSeq object.
|
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
order(RandSeq randSeq,
Collection<T> collection)
Applies the given
randSeq to rearrange the given collection in a random order. |
<T> Iterator<T> |
reorder(Iterator<T> sequence)
Returns an iterator that visits the elements of the given sequence in a random order.
|
<T> List<T> |
reorder(List<T> sequence)
Returns the given list with its elements rearranged in a random order.
|
static <T> Iterator<T> |
reorderIf(RandSeq randSeq,
Iterator<T> sequence)
Applies the given
randSeq to rearrange the given sequence in a random order. |
static <T> List<T> |
reorderIf(RandSeq randSeq,
List<T> sequence)
Applies the given
randSeq to rearrange the given sequence in a random order. |
public RandSeq(Random generator)
public RandSeq()
public RandSeq(long seed)
public <T> List<T> reorder(List<T> sequence)
public <T> Iterator<T> reorder(Iterator<T> sequence)
public static <T> List<T> reorderIf(RandSeq randSeq, List<T> sequence)
randSeq
to rearrange the given sequence in a random order.
If randSeq
is null
, returns the sequence unchanged.public static <T> List<T> order(RandSeq randSeq, Collection<T> collection)
randSeq
to rearrange the given collection in a random order.
If randSeq
is null
, returns the collection in normal order.Copyright © 2024 The Cornutum Project. All rights reserved.