Package jsl.utilities.random.robj
Class DUniformList<T>
- java.lang.Object
-
- jsl.utilities.random.robj.RList<T>
-
- jsl.utilities.random.robj.DUniformList<T>
-
- Type Parameters:
T- the type of element stored in the list
- All Implemented Interfaces:
java.lang.Iterable<T>,java.util.Collection<T>,java.util.List<T>,GetRandomNumberStreamIfc,RNStreamControlIfc,SetRandomNumberStreamIfc,RElementIfc<T>,RListIfc<T>
public class DUniformList<T> extends RList<T>
Uniformly selects elements from the list (with equal probability)
-
-
Field Summary
-
Fields inherited from class jsl.utilities.random.robj.RList
myElements, myStream
-
-
Constructor Summary
Constructors Constructor Description DUniformList()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetRandomElement()Returns an element randomly selected from the liststatic voidmain(java.lang.String[] args)RList<T>newInstance()-
Methods inherited from class jsl.utilities.random.robj.RList
add, add, addAll, addAll, advanceToNextSubstream, clear, contains, containsAll, get, getAntitheticOption, getList, getRandomNumberStream, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, resetStartStream, resetStartSubstream, retainAll, set, setAntitheticOption, setRandomNumberStream, size, subList, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsl.utilities.random.rng.GetRandomNumberStreamIfc
getStreamNumber
-
Methods inherited from interface jsl.utilities.random.rng.SetRandomNumberStreamIfc
setRandomNumberStream
-
-
-
-
Method Detail
-
getRandomElement
public T getRandomElement()
Description copied from interface:RElementIfcReturns an element randomly selected from the list- Specified by:
getRandomElementin interfaceRElementIfc<T>- Specified by:
getRandomElementin classRList<T>- Returns:
- a randomly selected element from the list
-
newInstance
public RList<T> newInstance()
- Specified by:
newInstancein classRList<T>
-
main
public static void main(java.lang.String[] args)
-
-