 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file.
19 package ca.uqac.lif.synthia.collection;
21 import java.util.ArrayList;
22 import java.util.List;
60 @SuppressWarnings(
"unchecked")
65 int size = list.size();
66 int position = (int) Math.floor(
m_position.
pick() * (double) size);
67 T e = list.get(position);
71 List<T> new_list =
new ArrayList<T>(size);
72 for (
int i = 0; i < size; i++)
80 new_list.add(list.get(i));
MutateElement(Picker<? extends List< T >> picker, Picker< Float > position, Picker< Mutator<? extends T >> mutator)
Creates a new instance of the picker.
void reset()
Puts the picker back into its initial state.
Picker<? extends T > m_picker
The underlying picker producing the values to transform.
Miscellaneous pickers performing various functions.
MutateElement< T > duplicate(boolean with_state)
Creates a copy of the picker.
Picker that selects an element of a list and applies the result of a mutator on this element.
Mutator< T > setPicker(Picker<? extends T > picker)
Sets the picker producing the values to transform.
Picker< Mutator<? extends T > > m_mutator
A mutator picker to mutate elements of the list.
Picker that returns the same object every time.
List< T > pick()
Picks an object.
A picker that applies a transformation ("mutation") on the value produced by another picker.
Picker< T > duplicate(boolean with_state)
Creates a copy of the picker.
void reset()
Puts the picker back into its initial state.
Picker< Float > m_position
A picker used to select the position of the first element.