 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file. 1 package ca.uqac.lif.synthia.string;
64 if (element.isEmpty())
84 boolean picked_bool = initial_bool;
85 StringBuilder substring =
new StringBuilder();
87 while ((initial_bool == picked_bool) && (i <
m_string.length()))
91 substring.append(
m_string.charAt(i));
99 while ((picked_bool) && (i <
m_string.length()))
101 substring.append(
m_string.charAt(i));
107 return substring.toString();
RandomPicker that produces random substrings from an original one.
Interface signaling that a picker can be shrunk.
Miscellaneous pickers performing various functions.
String m_string
The string used to generate substrings.
static final transient RandomFloat instance
A public static instance of RandomFloat.
Picker< String > duplicate(boolean with_state)
Creates a copy of the picker.
Pickers that produce pseudo-random objects such as numbers.
String pick()
Picks an object.
Boolean pick()
Picks a random boolean.
A RelativePicker that only throws a NoMoreElementException when the pick() method is called.
void reset()
Puts the picker back into its initial state.
Shrinkable< String > shrink(String element, Picker< Float > decision, float magnitude)
Create a new RandomSubString picker based on a given string.
RandomBoolean duplicate(boolean with_state)
Creates a copy of the RandomBoolean picker.
Picks an object based on the value of a random number generator.
RandomSubString setSeed(int seed)
Set the seed of the random generator.
RandomPicker< T > setSeed(int seed)
Set the seed of the random generator.
Picks a floating point number uniformly in an interval.
Shrinkable< String > shrink(String o)
Interface implemented by objects that can be seeded.
void reset()
Puts the picker back into its initial state.
RandomBoolean m_charSelect
A RandomBoolean picker to select if we pick a character or not.
RandomSubString(String s)
Public constructor used to create a new instance of the class.