Synthia
Generic and flexible data structure generator
ca.uqac.lif.synthia.util.Delay Class Reference

Detailed Description

Picker that does not produce any value, but causes the thread to wait for a moment on every call to pick().

Author
Sylvain Hallé

Definition at line 28 of file Delay.java.

Inheritance diagram for ca.uqac.lif.synthia.util.Delay:

Public Member Functions

 Delay (Picker<? extends Number > delay)
 Creates a new delay picker. More...
 
void reset ()
 Puts the picker back into its initial state. More...
 
Object pick ()
 Picks an object. More...
 
Delay duplicate (boolean with_state)
 Creates a copy of the picker. More...
 

Static Public Member Functions

static void wait (float duration)
 Waits for some time. More...
 

Protected Attributes

Picker<? extends Number > m_delay
 The picker deciding on the time to wait, in seconds. More...
 

Constructor & Destructor Documentation

◆ Delay()

ca.uqac.lif.synthia.util.Delay.Delay ( Picker<? extends Number >  delay)

Creates a new delay picker.

Parameters
delayThe picker deciding on the time to wait, in seconds

Definition at line 39 of file Delay.java.

Member Function Documentation

◆ duplicate()

Delay ca.uqac.lif.synthia.util.Delay.duplicate ( boolean  with_state)

Creates a copy of the picker.

Parameters
with_stateIf set to false, the returned copy is set to the class' initial state (i.e. same thing as calling the picker's constructor). If set to true, the returned copy is put into the same internal state as the object it is copied from.
Returns
The copy of the picker

Implements ca.uqac.lif.synthia.Picker< T >.

Definition at line 59 of file Delay.java.

◆ pick()

Object ca.uqac.lif.synthia.util.Delay.pick ( )

Picks an object.

Typically, this method is expected to return non-null objects; a null return value is used to signal that no more objects will be produced. That is, once this method returns null, it should normally return null on all subsequent calls.

Returns
The object

Implements ca.uqac.lif.synthia.Picker< T >.

Definition at line 52 of file Delay.java.

◆ reset()

void ca.uqac.lif.synthia.util.Delay.reset ( )

Puts the picker back into its initial state.

This means that the sequence of calls to pick() will produce the same values as when the object was instantiated.

Implements ca.uqac.lif.synthia.Picker< T >.

Definition at line 46 of file Delay.java.

◆ wait()

static void ca.uqac.lif.synthia.util.Delay.wait ( float  duration)
static

Waits for some time.

Parameters
durationThe time to wait, in seconds

Definition at line 68 of file Delay.java.

Member Data Documentation

◆ m_delay

Picker<? extends Number> ca.uqac.lif.synthia.util.Delay.m_delay
protected

The picker deciding on the time to wait, in seconds.

Definition at line 33 of file Delay.java.


The documentation for this class was generated from the following file: