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>
myElements
protected RNStreamIfc
myStream
-
Constructor Summary
Constructors Constructor Description RList()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(int index, T element)
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 objectboolean
addAll(int index, java.util.Collection<? extends T> c)
boolean
addAll(java.util.Collection<? extends T> c)
void
advanceToNextSubstream()
Positions the RNG at the beginning of its next substreamvoid
clear()
boolean
contains(java.lang.Object arg0)
boolean
containsAll(java.util.Collection<?> arg0)
T
get(int index)
boolean
getAntitheticOption()
java.util.List<T>
getList()
abstract T
getRandomElement()
Returns an element randomly selected from the listRNStreamIfc
getRandomNumberStream()
int
indexOf(java.lang.Object arg0)
boolean
isEmpty()
java.util.Iterator<T>
iterator()
int
lastIndexOf(java.lang.Object o)
java.util.ListIterator<T>
listIterator()
java.util.ListIterator<T>
listIterator(int index)
abstract RList<T>
newInstance()
T
remove(int index)
boolean
remove(java.lang.Object obj)
boolean
removeAll(java.util.Collection<?> c)
void
resetStartStream()
The resetStartStream method will position the RNG at the beginning of its stream.void
resetStartSubstream()
Resets the position of the RNG at the start of the current substreamboolean
retainAll(java.util.Collection<?> c)
T
set(int index, T element)
void
setAntitheticOption(boolean flag)
Tells the stream to start producing antithetic variatesvoid
setRandomNumberStream(RNStreamIfc stream)
Sets the underlying random number streamint
size()
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:RElementIfc
Returns an element randomly selected from the list- Specified by:
getRandomElement
in 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:
indexOf
in 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:
addAll
in 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:
lastIndexOf
in interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator(int index)
- Specified by:
listIterator
in 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:
subList
in 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:RNStreamControlIfc
Positions the RNG at the beginning of its next substream- Specified by:
advanceToNextSubstream
in interfaceRNStreamControlIfc
-
resetStartStream
public void resetStartStream()
Description copied from interface:RNStreamControlIfc
The 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:
resetStartStream
in interfaceRNStreamControlIfc
-
resetStartSubstream
public void resetStartSubstream()
Description copied from interface:RNStreamControlIfc
Resets the position of the RNG at the start of the current substream- Specified by:
resetStartSubstream
in interfaceRNStreamControlIfc
-
setAntitheticOption
public void setAntitheticOption(boolean flag)
Description copied from interface:RNStreamControlIfc
Tells the stream to start producing antithetic variates- Specified by:
setAntitheticOption
in interfaceRNStreamControlIfc
- Parameters:
flag
- true means that it produces antithetic variates.
-
getAntitheticOption
public final boolean getAntitheticOption()
- Specified by:
getAntitheticOption
in interfaceRNStreamControlIfc
- Returns:
- true means on
-
getRandomNumberStream
public final RNStreamIfc getRandomNumberStream()
- Specified by:
getRandomNumberStream
in interfaceGetRandomNumberStreamIfc
- Returns:
- the random number stream reference
-
setRandomNumberStream
public void setRandomNumberStream(RNStreamIfc stream)
Description copied from interface:SetRandomNumberStreamIfc
Sets the underlying random number stream- Specified by:
setRandomNumberStream
in interfaceSetRandomNumberStreamIfc
- Parameters:
stream
- the reference to the random number stream, must not be null
-
-