 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file. 1 package ca.uqac.lif.synthia.random;
8 import java.util.ArrayList;
88 List<T> output_list =
new ArrayList<>();
95 output_list.add(m_element);
131 if (!element.getClass().getSimpleName().equals(
"ArrayList"))
137 List<T> objects = (List<T>) element;
139 if (objects.isEmpty())
RandomPicker that produces random substrings from an original one.
Interface signaling that a picker can be shrunk.
RandomBoolean m_pick
RandomBoolean used to determine if a element of the list will be added in the sublist or not.
Miscellaneous pickers performing various functions.
RandomSubList(List< T > elements, Shrinkable< T > list_reducer)
Public method to create a new instance of the class.
Shrinkable< T > m_listReducer
Shrinkable to reduce elements when m_asIs decides that the curent element will be reduced.
static final transient RandomFloat instance
A public static instance of RandomFloat.
void reset()
Puts the picker back into its initial state.
List< T > m_elements
The list of elements used to generate sublists.
Pickers producing and manipulating character strings.
Shrinkable< List< T > > shrink(List< T > o)
Boolean pick()
Picks a random boolean.
Picker< List< T > > duplicate(boolean with_state)
Creates a copy of the picker.
RandomBoolean m_asIs
If the element will be added in the sublist, this RandomBoolean is used to determine if the element w...
A RelativePicker that only throws a NoMoreElementException when the pick() method is called.
void reset()
Puts the picker back into its initial state.
RandomBoolean duplicate(boolean with_state)
Creates a copy of the RandomBoolean picker.
Shrinkable< List< T > > shrink(List< T > element, Picker< Float > decision, float magnitude)
Create a new RandomSubList picker based on a given list.
List< T > pick()
Picks an object.
Picks a floating point number uniformly in an interval.
An equivalent of RandomSubString but for lists.