com.oakgrovesystems.mediation
Class Inversion

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

public class Inversion
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, an Inversion is a function of exactly one other Condition. If the other Condition is true, the Inversion is false. If the other Condition is false, the Inversion is true.

Author:
Craig Vieregg
See Also:
Serialized Form

Field Summary
protected  com.oakgrovesystems.mediation.Condition conditionToInvert
           
 
Constructor Summary
Inversion(com.oakgrovesystems.mediation.Condition conditionToInvert)
          Creates a new Inversion which is the inverse of the Condition specified
 
Method Summary
 com.oakgrovesystems.mediation.Condition getCondition()
          Returns the Condition with respect to which this Inversion is an inverse
 boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c, java.lang.Object o)
          returns false if the condtionToInvert is null.
 boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c, java.lang.Object o)
          returns false if the condtionToInvert is null.
 boolean isTrue()
          Evaluates this Inversion.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

conditionToInvert

protected com.oakgrovesystems.mediation.Condition conditionToInvert
Constructor Detail

Inversion

public Inversion(com.oakgrovesystems.mediation.Condition conditionToInvert)
Creates a new Inversion which is the inverse of the Condition specified

Parameters:
conditionToInvert - The Condition with respect to which this Inversion is an inverse
Method Detail

getCondition

public com.oakgrovesystems.mediation.Condition getCondition()
Returns the Condition with respect to which this Inversion is an inverse

Returns:
The Condition with respect to which this Inversion is an inverse

isTrue

public boolean isTrue()
               throws CanNotEvaluateConditionException
Evaluates this Inversion. Returns true if the conditionToInvert is false. Returns false if the conditionToInvert is true.

Specified by:
isTrue in interface Condition
Returns:
true if the conditionToInvert is false. false if the conditionToInvert is true.
Throws:
CanNotEvaluateConditionException - If the conditionToInvert is null or can not be evaluated.

isMadeTrueBy

public boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c,
                            java.lang.Object o)
                     throws CanNotEvaluateConditionException
returns false if the condtionToInvert is null. Otherwise returns the result of a call to condtionToInvert.isMadeFalseBy() with the same arguments.

Specified by:
isMadeTrueBy in interface Condition
Parameters:
c - The Change the application of which could make this Inversion true
o - The object to which the change would be applied to make this Inversion true
Returns:
false if the condtionToInvert is null. Otherwise returns the result of a call to condtionToInvert.isMadeFalseBy() with the same arguments.
Throws:
CanNotEvaluateConditionException - if the call to conditionToInvert.isMadeFalseBy() throws a CanNotEvaluateConditionException

isMadeFalseBy

public boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c,
                             java.lang.Object o)
                      throws CanNotEvaluateConditionException
returns false if the condtionToInvert is null. Otherwise returns the result of a call to condtionToInvert.isMadeTrueBy() with the same arguments.

Specified by:
isMadeFalseBy in interface Condition
Parameters:
c - The Change the application of which could make this Inversion false
o - The object to which the change would be applied to make this Inversion false
Returns:
false if the condtionToInvert is null. Otherwise returns the result of a call to condtionToInvert.isMadeTrueBy() with the same arguments.
Throws:
CanNotEvaluateConditionException - if the call to conditionToInvert.isMadeTrueBy() throws a CanNotEvaluateConditionException

toString

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


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