 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file. 1 package ca.uqac.lif.synthia.enumerative;
9 import java.util.ArrayList;
10 import java.util.List;
28 @SuppressWarnings(
"unchecked")
30 , List<Integer> indexes,
boolean loop,
int index,
int start_index)
41 public AllElements(List<T> values,
boolean scramble,
boolean loop)
57 private void initializeIndexes()
59 for (
int i = 0; i <
m_values.length; i++)
70 return (T) super.pick();
74 return scramblePick();
78 private T scramblePick()
void reset()
Puts the Playback picker back into its initial state.
AllElements< T > duplicate(boolean with_state)
Picks a random string.
List< Integer > m_indexes
boolean isDone()
Signals if the picker enumerates all values from a set.
AllElements< T > setSeed(int seed)
Set the seed of the random generator.
int m_index
The index of the current value.
T[] m_values
The values to play back.
boolean m_loop
Whether to loop through the values.
Picker that returns values taken from a list.
Pickers that produce pseudo-random objects such as numbers.
T pick()
Picks the next value in the list of the Playback picker.
Playback< T > setLoop(boolean b)
Set the m_loop attribute of the playback picker.
RandomInteger setInterval(int min, int max)
Sets the interval in which integers are picked.
Interface used to signal that a picker enumerates all values from a set.
void reset()
Puts the picker back into its initial state.
int m_startIndex
The start index.
RandomInteger setSeed(int seed)
Picks an integer uniformly in an interval.
Integer pick()
Picks a random integer.
RandomInteger duplicate(boolean with_state)
Creates a copy of the RandomInteger picker.
AllElements(List< T > values, boolean scramble, boolean loop)
An exception to throw when a picker can't pick an other element.
RandomInteger m_indexPicker
Interface implemented by objects that can be seeded.
Pickers related to the generation of a sequence of values.