Package jsl.utilities.random.robj
Class RList<T>
- java.lang.Object
-
- jsl.utilities.random.robj.RList<T>
-
- Type Parameters:
T- the type 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>
- Direct Known Subclasses:
DUniformList
public abstract class RList<T> extends java.lang.Object implements RListIfc<T>
Defines an abstract base class for random lists
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<T>myElementsprotected RNStreamIfcmyStream
-
Constructor Summary
Constructors Constructor Description RList()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(int index, T element)booleanadd(T obj)The object cannot be null, but it can be added more than once See how List handles multiple instances of the same objectbooleanaddAll(int index, java.util.Collection<? extends T> c)booleanaddAll(java.util.Collection<? extends T> c)voidadvanceToNextSubstream()Positions the RNG at the beginning of its next substreamvoidclear()booleancontains(java.lang.Object arg0)booleancontainsAll(java.util.Collection<?> arg0)Tget(int index)booleangetAntitheticOption()java.util.List<T>getList()abstract TgetRandomElement()Returns an element randomly selected from the listRNStreamIfcgetRandomNumberStream()intindexOf(java.lang.Object arg0)booleanisEmpty()java.util.Iterator<T>iterator()intlastIndexOf(java.lang.Object o)java.util.ListIterator<T>listIterator()java.util.ListIterator<T>listIterator(int index)abstract RList<T>newInstance()Tremove(int index)booleanremove(java.lang.Object obj)booleanremoveAll(java.util.Collection<?> c)voidresetStartStream()The resetStartStream method will position the RNG at the beginning of its stream.voidresetStartSubstream()Resets the position of the RNG at the start of the current substreambooleanretainAll(java.util.Collection<?> c)Tset(int index, T element)voidsetAntitheticOption(boolean flag)Tells the stream to start producing antithetic variatesvoidsetRandomNumberStream(RNStreamIfc stream)Sets the underlying random number streamintsize()java.util.List<T>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] a)-
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
-
-
-
-
Field Detail
-
myElements
protected java.util.List<T> myElements
-
myStream
protected RNStreamIfc myStream
-
-
Method Detail
-
add
public boolean add(T obj)
The object cannot be null, but it can be added more than once See how List handles multiple instances of the same object
-
remove
public boolean remove(java.lang.Object obj)
-
getRandomElement
public abstract T getRandomElement()
Description copied from interface:RElementIfcReturns an element randomly selected from the list- Specified by:
getRandomElementin interfaceRElementIfc<T>- Returns:
- a randomly selected element from the list
-
contains
public boolean contains(java.lang.Object arg0)
-
containsAll
public boolean containsAll(java.util.Collection<?> arg0)
-
indexOf
public int indexOf(java.lang.Object arg0)
- Specified by:
indexOfin interfacejava.util.List<T>
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
getList
public java.util.List<T> getList()
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends T> c)- Specified by:
addAllin interfacejava.util.List<T>
-
clear
public void clear()
-
iterator
public java.util.Iterator<T> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<T>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
subList
public java.util.List<T> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<T>
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
advanceToNextSubstream
public void advanceToNextSubstream()
Description copied from interface:RNStreamControlIfcPositions the RNG at the beginning of its next substream- Specified by:
advanceToNextSubstreamin interfaceRNStreamControlIfc
-
resetStartStream
public void resetStartStream()
Description copied from interface:RNStreamControlIfcThe resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.- Specified by:
resetStartStreamin interfaceRNStreamControlIfc
-
resetStartSubstream
public void resetStartSubstream()
Description copied from interface:RNStreamControlIfcResets the position of the RNG at the start of the current substream- Specified by:
resetStartSubstreamin interfaceRNStreamControlIfc
-
setAntitheticOption
public void setAntitheticOption(boolean flag)
Description copied from interface:RNStreamControlIfcTells the stream to start producing antithetic variates- Specified by:
setAntitheticOptionin interfaceRNStreamControlIfc- Parameters:
flag- true means that it produces antithetic variates.
-
getAntitheticOption
public final boolean getAntitheticOption()
- Specified by:
getAntitheticOptionin interfaceRNStreamControlIfc- Returns:
- true means on
-
getRandomNumberStream
public final RNStreamIfc getRandomNumberStream()
- Specified by:
getRandomNumberStreamin interfaceGetRandomNumberStreamIfc- Returns:
- the random number stream reference
-
setRandomNumberStream
public void setRandomNumberStream(RNStreamIfc stream)
Description copied from interface:SetRandomNumberStreamIfcSets the underlying random number stream- Specified by:
setRandomNumberStreamin interfaceSetRandomNumberStreamIfc- Parameters:
stream- the reference to the random number stream, must not be null
-
-