com.oakgrovesystems.reactor.processMediation
Class ProcessConditionalChange

java.lang.Object
  |
  +--com.oakgrovesystems.mediation.AbstractConditionalChange
        |
        +--com.oakgrovesystems.reactor.processMediation.ProcessConditionalChange
All Implemented Interfaces:
Change, ConditionalChange, ProcessChange, java.io.Serializable
Direct Known Subclasses:
ProcessChangeCondition, ProcessPrecondition

public abstract class ProcessConditionalChange
extends AbstractConditionalChange
implements ProcessChange, java.io.Serializable

A change to a Process that may only be applied if a particular ProcessCondition is true

See Also:
Serialized Form

Field Summary
protected  java.util.Map objectMap
          the Map used for looking up Process objects for condition evaluation
 
Fields inherited from class com.oakgrovesystems.mediation.AbstractConditionalChange
precondition, resultingChange
 
Constructor Summary
ProcessConditionalChange()
           
 
Method Summary
 com.oakgrovesystems.reactor.processMediation.ProcessCondition getCondition()
          returns the ProcessCondition that must be true for this ProcessConditionalChange to be applicable.
 java.util.Map getObjectMap()
          returns the Map used for looking up Process objects for condition evaluation
 com.oakgrovesystems.reactor.processMediation.ProcessChange getResultingChange()
          returns the ProcessChange that may be applied when the precondition is true.
 boolean isApplicable()
          Tests the applicability of this ConditionalChange.
 boolean isMadeApplicableBy(com.oakgrovesystems.mediation.Change change, java.lang.Object changee)
          Determines whether the ConditionalChange would become applicable if the specified Change was applied to the specified object.
 boolean isMadeInapplicableBy(com.oakgrovesystems.mediation.Change change, java.lang.Object changee)
          Determines whether the ConditionalChange would become inapplicable if the specified Change was applied to the specified object.
abstract  boolean sameAs(java.lang.Object o)
          compares this object for content equality with another object
 void setObjectMap(java.util.Map objectMap)
          sets the Map used for looking up Process objects for condition evaluation
 
Methods inherited from class com.oakgrovesystems.mediation.AbstractConditionalChange
applyTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.oakgrovesystems.mediation.Change
applyTo
 

Field Detail

objectMap

protected java.util.Map objectMap
the Map used for looking up Process objects for condition evaluation

Constructor Detail

ProcessConditionalChange

public ProcessConditionalChange()
Method Detail

getObjectMap

public java.util.Map getObjectMap()
returns the Map used for looking up Process objects for condition evaluation

Returns:
the Map used for looking up Process objects for condition evaluation

setObjectMap

public void setObjectMap(java.util.Map objectMap)
sets the Map used for looking up Process objects for condition evaluation

Parameters:
objectMap - the Map used for looking up Process objects for condition evaluation

getCondition

public com.oakgrovesystems.reactor.processMediation.ProcessCondition getCondition()
returns the ProcessCondition that must be true for this ProcessConditionalChange to be applicable.

Returns:
the ProcessCondition that must be true for this ProcessConditionalChange to be applicable.

getResultingChange

public com.oakgrovesystems.reactor.processMediation.ProcessChange getResultingChange()
returns the ProcessChange that may be applied when the precondition is true.

Returns:
the ProcessChange that may be applied when the precondition is true.

isApplicable

public boolean isApplicable()
                     throws CanNotEvaluateConditionException
Tests the applicability of this ConditionalChange. If the isApplicable() method of a ConditionalChange returns false, attempts to call the applyTo() method should throw a ChangeNotApplicableException.

Specified by:
isApplicable in interface ConditionalChange
Overrides:
isApplicable in class AbstractConditionalChange
Returns:
True if the change can be applied. False if the change can not be applied.
Throws:
CanNotEvaluateConditionException - thrown if the contingency Condition can not be evaluated.

isMadeApplicableBy

public boolean isMadeApplicableBy(com.oakgrovesystems.mediation.Change change,
                                  java.lang.Object changee)
                           throws CanNotEvaluateConditionException
Determines whether the ConditionalChange would become applicable if the specified Change was applied to the specified object.

Specified by:
isMadeApplicableBy in interface ConditionalChange
Overrides:
isMadeApplicableBy in class AbstractConditionalChange
Parameters:
change - the Change that would be applied to trigger the applicability of this ConditionalChange
changee - the object to which the triggering change would be applied
Returns:
False if this ConditionalChange is already applicable or if it is currently inapplicable and would remain inapplicable despite the application of the specified Change. True if the Change is not currently applicable but would be applicable if the specified Change were applied to the specified Object.
Throws:
CanNotEvaluateConditionException

isMadeInapplicableBy

public boolean isMadeInapplicableBy(com.oakgrovesystems.mediation.Change change,
                                    java.lang.Object changee)
                             throws CanNotEvaluateConditionException
Determines whether the ConditionalChange would become inapplicable if the specified Change was applied to the specified object.

Specified by:
isMadeInapplicableBy in interface ConditionalChange
Overrides:
isMadeInapplicableBy in class AbstractConditionalChange
Parameters:
change - the Change that would be applied to cause the inapplicability of this ConditionalChange
changee - the object to which the specified change would be applied to make this ConditionalChange inapplicable
Returns:
False if this ConditionalChange is already inapplicable or if it is currently applicable and would remain applicable despite the application of the specified Change. True if the Change is currently applicable but would be inapplicable if the specified Change were applied to the specified Object.
Throws:
CanNotEvaluateConditionException

sameAs

public abstract boolean sameAs(java.lang.Object o)
compares this object for content equality with another object

Specified by:
sameAs in interface ProcessChange
Parameters:
o - the object with which this object should be compared for equality
Returns:
a boolean indicating if the objects are equal


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