public class ElementFromListRandomField<E> extends Object implements RandomField
RandomField
representing an arbitrary object that is filled with a random
list element.RND
Constructor and Description |
---|
ElementFromListRandomField(E[] possibleElements)
Some constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getNullProbability()
Returns the probability for this field returning null.
|
E |
nextValue()
Returns a random value.
|
ElementFromListRandomField<E> |
nullProbability(double newNullProbability)
Sets the probability for this field returning null.
|
void |
setNullProbability(double nullProbability)
Sets the probability for this field returning null.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public ElementFromListRandomField(E[] possibleElements)
possibleElements
- the elements that are possible here; never nullpublic E nextValue()
RandomField
nextValue
in interface RandomField
public double getNullProbability()
nextValue()
is null, if it is 1 then every nextValue()
is null.public ElementFromListRandomField<E> nullProbability(double newNullProbability)
nextValue()
is null, if it is 1 then every nextValue()
is null.newNullProbability
- the probability between 0 and 1public void setNullProbability(double nullProbability)
nextValue()
is null, if it is 1 then every nextValue()
is null.nullProbability
- the probability between 0 and 1Copyright © 2020. All rights reserved.