public class WordRandomField extends Object implements RandomField
WordGeneratorConfig
.Constructor and Description |
---|
WordRandomField()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
WordRandomField |
config(WordGeneratorConfig newConfig)
Sets the used config.
|
WordGeneratorConfig |
getConfig()
Returns the used config.
|
double |
getNullProbability()
Returns the probability for this field returning null.
|
String |
nextValue()
Generates a brand new word.
|
WordRandomField |
nullProbability(double newNullProbability)
Sets the probability for this field returning null.
|
void |
setConfig(WordGeneratorConfig config)
Sets the used config.
|
void |
setNullProbability(double nullProbability)
Sets the probability for this field returning null.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public String nextValue()
nextValue
in interface RandomField
public WordGeneratorConfig getConfig()
public WordRandomField config(WordGeneratorConfig newConfig)
newConfig
- a configpublic void setConfig(WordGeneratorConfig config)
config
- a configpublic double getNullProbability()
nextValue()
is null, if it is 1 then every nextValue()
is null.public WordRandomField 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.