ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.msk.conditions
Class OrCondition

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.msk.conditions.OrCondition
All Implemented Interfaces:
Initializable, Condition, ToggleElement

public class OrCondition
extends Object
implements Condition, Initializable, ToggleElement

Represents a condition checking that at least one of a list of conditions applies.


Constructor Summary
OrCondition(Condition... condList)
          Constructs a new or condition based on the list of conditions condList.
 
Method Summary
 boolean applies(Contact contact)
          Checks the represented condition for the given contact contact, and returns true if and only if the condition applies.
 Condition[] getConditions()
          Returns the associated list of conditions.
 void init()
          Calls stop(), then calls init for each initializable condition associated with this object.
 boolean isStarted()
          Determines if the element is enabled or disabled.
 void start()
          Calls start for each associated condition implementing the ToggleElement interface.
 void stop()
          Calls stop for each associated condition implementing the ToggleElement interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrCondition

public OrCondition(Condition... condList)
Constructs a new or condition based on the list of conditions condList.

Parameters:
condList - the list on conditions used to perform the test.
Method Detail

getConditions

public Condition[] getConditions()
Returns the associated list of conditions.


applies

public boolean applies(Contact contact)
Description copied from interface: Condition
Checks the represented condition for the given contact contact, and returns true if and only if the condition applies. Some conditions depend on the state of the system rather than a particular contact. In such cases, the contact object can be ignored.

Specified by:
applies in interface Condition
Parameters:
contact - the contact on which to check the condition.
Returns:
the success indicator of the test.

isStarted

public boolean isStarted()
Description copied from interface: ToggleElement
Determines if the element is enabled or disabled. Returns true if the element is enabled, false otherwise.

Specified by:
isStarted in interface ToggleElement
Returns:
the current state of the element.

start

public void start()
Calls start for each associated condition implementing the ToggleElement interface.

Specified by:
start in interface ToggleElement

stop

public void stop()
Calls stop for each associated condition implementing the ToggleElement interface.

Specified by:
stop in interface ToggleElement

init

public void init()
Calls stop(), then calls init for each initializable condition associated with this object.

Specified by:
init in interface Initializable

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.