public class WordsRandomField extends Object implements RandomField
WordGeneratorConfig.RND| Constructor and Description |
|---|
WordsRandomField() |
| Modifier and Type | Method and Description |
|---|---|
WordsRandomField |
config(WordGeneratorConfig newConfig)
Sets the used config.
|
WordGeneratorConfig |
getConfig()
Returns the used config.
|
double |
getNullProbability()
Returns the probability for this field returning null.
|
int |
getParagraphCount()
Returns the number of paragraphs.
|
String |
nextValue()
Generates a brand new word.
|
WordsRandomField |
nullProbability(double newNullProbability)
Sets the probability for this field returning null.
|
WordsRandomField |
paragraphCount(int newParagraphCount)
Sets the standard number of paragraphs.
|
void |
setConfig(WordGeneratorConfig config)
Sets the used config.
|
void |
setNullProbability(double nullProbability)
Sets the probability for this field returning null.
|
void |
setParagraphCount(int paragraphCount)
Sets the standard number of paragraphs.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitpublic String nextValue()
nextValue in interface RandomFieldpublic WordGeneratorConfig getConfig()
public WordsRandomField config(WordGeneratorConfig newConfig)
newConfig - a configpublic void setConfig(WordGeneratorConfig config)
config - a configpublic int getParagraphCount()
public WordsRandomField paragraphCount(int newParagraphCount)
newParagraphCount - paragraph countpublic void setParagraphCount(int paragraphCount)
paragraphCount - paragraph countpublic double getNullProbability()
nextValue() is null, if it is 1 then every nextValue() is null.public WordsRandomField 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.