Synthia
Generic and flexible data structure generator
Reactive.java
Go to the documentation of this file.
1 /*
2  Synthia, a data structure generator
3  Copyright (C) 2019-2020 Laboratoire d'informatique formelle
4  Université du Québec à Chicoutimi, Canada
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 package ca.uqac.lif.synthia;
20 
21 /**
22  * Interface implemented by pickers whose picking of objects can be altered by
23  * external information. To this end, a reactive picker provides a method
24  * called {@link #tell(Object) tell}, which is used to pass an object that the
25  * picker may use to modify its internal state or the way the next value will
26  * be produced.
27  * <p>
28  * A simple example of a reactive picker is {@link RandomInteger}; in this
29  * case, method <tt>tell</tt> is used to modify the upper bound of its range
30  * of possible values. {@link RandomBoolean} uses <tt>tell</tt> to modify the
31  * probability of producing value <tt>true</tt>, and {@link PoissonInteger}
32  * uses it to modify its parameter &lambda;.
33  * <p>
34  * Reactive pickers are especially useful in the context of testing of an
35  * interactive component, such as a user interface.
36  *
37  * @author Sylvain Hallé
38  *
39  * @param <T> The type of objects returned by the picker
40  * @param <U> The type of objects used in a notification to the picker
41  * @ingroup API
42  */
43 public interface Reactive<U,T> extends Picker<T>
44 {
45  /**
46  * Notifies a picker of some external information.
47  * @param u The information
48  */
49  public void tell(U u);
50 }
ca.uqac.lif.synthia.Picker
Picks an object.
Definition: Picker.java:36
ca.uqac.lif.synthia.Reactive
Interface implemented by pickers whose picking of objects can be altered by external information.
Definition: Reactive.java:43
ca.uqac.lif.synthia.Reactive.tell
void tell(U u)
Notifies a picker of some external information.