com.oakgrovesystems.mediation
Class Disjunction

java.lang.Object
  |
  +--com.oakgrovesystems.mediation.Disjunction
All Implemented Interfaces:
Condition, java.io.Serializable
Direct Known Subclasses:
ProcessConditionDisjunction

public class Disjunction
extends java.lang.Object
implements Condition, java.io.Serializable

A compound Condition (a Condition that is a boolean function of the state of one or more other Conditions). Specfically, a Disjunction is a function of a set of other Conditions. If one or more of the other Conditions are true, the Disjunction is true. If all of the other Conditions are false, the Disjunction is false.

Author:
Craig Vieregg
See Also:
Serialized Form

Field Summary
protected  java.util.Set conditions
           
 
Constructor Summary
Disjunction(java.util.Set conditions)
          Creates a new Disjunction that is a function of the specified Set of other Conditions
 
Method Summary
 java.util.Set getConditions()
          returns the Set of Conditions of which this Disjunction is a function.
 boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c, java.lang.Object o)
          Returns true if at least one of the Conditions in the set is currently true, and all of the Condtions in the Set that are currently true return true from a call to Condition.isMadeFalseBy() with the same arguments.
 boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c, java.lang.Object o)
          Returns true if all of the Conditions in the set are currently false, but at least one of them returns true from a call to Condition.isMadeTrueBy() with the same arguments.
 boolean isTrue()
          returns true if one or more of the Conditions in the Set are true, false if all of the Conditions in the Set are false.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

conditions

protected java.util.Set conditions
Constructor Detail

Disjunction

public Disjunction(java.util.Set conditions)
Creates a new Disjunction that is a function of the specified Set of other Conditions

Parameters:
conditions - The set of Conditions that this Disjunction is a function of.
Method Detail

getConditions

public java.util.Set getConditions()
returns the Set of Conditions of which this Disjunction is a function.

Returns:
the Set of Conditions of which this Disjunction is a function

isTrue

public boolean isTrue()
               throws CanNotEvaluateConditionException
returns true if one or more of the Conditions in the Set are true, false if all of the Conditions in the Set are false.

Specified by:
isTrue in interface Condition
Returns:
true if one or more of the Conditions in the Set are true, false if all of the Conditions in the Set are false.
Throws:
CanNotEvaluateConditionException - if the Set is null or contains an object that does not implement the Condition interface or if one of the Conditions in the Set can not be evaluated.

isMadeTrueBy

public boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c,
                            java.lang.Object o)
                     throws CanNotEvaluateConditionException
Returns true if all of the Conditions in the set are currently false, but at least one of them returns true from a call to Condition.isMadeTrueBy() with the same arguments. false otherwise.

Specified by:
isMadeTrueBy in interface Condition
Parameters:
c - The Change the application of which may make this Disjunction true.
o - The Object to which the Change would be applied
Returns:
true if all of the Conditions in the set are currently false, but at least one of them returns true from a call to Condition.isMadeTrueBy() with the same arguments. false otherwise.
Throws:
CanNotEvaluateConditionException - if the Set is null or contains an object that does not implement the Condition interface or a Condition in the Set can not be evaluated.

isMadeFalseBy

public boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c,
                             java.lang.Object o)
                      throws CanNotEvaluateConditionException
Returns true if at least one of the Conditions in the set is currently true, and all of the Condtions in the Set that are currently true return true from a call to Condition.isMadeFalseBy() with the same arguments. This method returns false otherwise.

Specified by:
isMadeFalseBy in interface Condition
Parameters:
c - The Change the application of which may make this Disjunction false.
o - The Object to which the Change would be applied
Returns:
true if at least one of the Conditions in the set is currently true, and all of the Condtions in the Set that are currently true return true from a call to Condition.isMadeFalseBy() with the same arguments. false otherwise.
Throws:
CanNotEvaluateConditionException - if the Set is null or contains an object that does not implement the Condition interface or a Condition in the Set can not be evaluated.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright (c) 1999-2004 Oak Grove Systems. All Rights Reserved.