com.oakgrovesystems.reactor.processMediation
Class ProcessStateEqualsCondition

java.lang.Object
  |
  +--com.oakgrovesystems.reactor.processMediation.AbstractProcessCondition
        |
        +--com.oakgrovesystems.reactor.processMediation.ProcessStateEqualsCondition
All Implemented Interfaces:
java.lang.Cloneable, Condition, ProcessCondition, java.io.Serializable

public class ProcessStateEqualsCondition
extends AbstractProcessCondition
implements java.lang.Cloneable, java.io.Serializable

A Condition that is true if a particular Process is in a certain state and false otherwise.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.oakgrovesystems.reactor.processMediation.AbstractProcessCondition
objectMap
 
Constructor Summary
ProcessStateEqualsCondition(com.oakgrovesystems.reactor.ReactorObjectId processId, int state)
          Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified.
ProcessStateEqualsCondition(com.oakgrovesystems.reactor.ReactorObjectId processId, int state, java.util.Map objectMap)
          Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified using the Map specified to dereference the id.
ProcessStateEqualsCondition(java.lang.String processId, int state)
          Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified.
ProcessStateEqualsCondition(java.lang.String processId, int state, java.util.Map objectMap)
          Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified using the Map specified to dereference the id.
 
Method Summary
 java.lang.Object clone()
          Clones this ProcessStateEqualsConditons.
 com.oakgrovesystems.reactor.processMediation.ProcessCondition copy()
          Clones this ProcessStateEqualsConditons.
 com.oakgrovesystems.reactor.ReactorObjectId getProcessId()
          returns the id of the process that must be in a particular state for this Condition to be true.
 int getState()
          returns the state a particular Process must be in for this Condition to be true.
 boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c, java.lang.Object changee)
          returns true if the Change specifies that the correct Process changes out of the correct state
 boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c, java.lang.Object changee)
          returns true if the Change specifies that the correct Process changes into the correct state
 boolean isTrue()
          Evaluated on the Process returned from a call to ReactorObjectId.dereference(Process.class) ReactorObjectId.dereference(Process.class,Map,true) depending on whether or not objectMap is null.
 boolean sameAs(java.lang.Object o)
          tests this ProcessStateEqualsCondition for content equality with another Object.
 void setProcessId(com.oakgrovesystems.reactor.ReactorObjectId processId)
          sets the id of the process that must be in a particular state for this Condition to be true.
 void setState(int state)
          sets the state a particular Process must be in for this Condition to be true.
 
Methods inherited from class com.oakgrovesystems.reactor.processMediation.AbstractProcessCondition
getObjectMap, setObjectMap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessStateEqualsCondition

public ProcessStateEqualsCondition(java.lang.String processId,
                                   int state)
Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified.

Parameters:
processId - the id of the Process to check the state of.
state - the state the Process must have for the Condition to be true

ProcessStateEqualsCondition

public ProcessStateEqualsCondition(com.oakgrovesystems.reactor.ReactorObjectId processId,
                                   int state)
Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified.

Parameters:
processId - the id of the Process to check the state of.
state - the state the Process must have for the Condition to be true

ProcessStateEqualsCondition

public ProcessStateEqualsCondition(java.lang.String processId,
                                   int state,
                                   java.util.Map objectMap)
Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified using the Map specified to dereference the id.

Parameters:
processId - the id of the Process to check the state of.
state - the state the Process must have for the Condition to be true
objectMap - the map to use to look up the Process

ProcessStateEqualsCondition

public ProcessStateEqualsCondition(com.oakgrovesystems.reactor.ReactorObjectId processId,
                                   int state,
                                   java.util.Map objectMap)
Creates a new ProcessStateEqualsCondition that checks the Process specified for the state specified using the Map specified to dereference the id.

Parameters:
processId - the id of the Process to check the state of.
state - the state the Process must have for the Condition to be true
objectMap - the map to use to look up the Process
Method Detail

isTrue

public boolean isTrue()
               throws CanNotEvaluateConditionException
Evaluated on the Process returned from a call to ReactorObjectId.dereference(Process.class) ReactorObjectId.dereference(Process.class,Map,true) depending on whether or not objectMap is null.

Specified by:
isTrue in interface Condition
Returns:
true if the Process is in the given state; false otherwise
Throws:
CanNotEvaluateConditionException - if object dereferencing fails or the ReactorObjectId is null.

isMadeTrueBy

public boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c,
                            java.lang.Object changee)
                     throws CanNotEvaluateConditionException
returns true if the Change specifies that the correct Process changes into the correct state

Specified by:
isMadeTrueBy in interface Condition
Parameters:
c - the change that may make this Condition true
changee - the Process to which the change is to be applied
Returns:
boolean indicating whether or not application of the Change specified to the Process specified would make this Condition true.
Throws:
CanNotEvaluateConditionException

isMadeFalseBy

public boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c,
                             java.lang.Object changee)
                      throws CanNotEvaluateConditionException
returns true if the Change specifies that the correct Process changes out of the correct state

Specified by:
isMadeFalseBy in interface Condition
Parameters:
c - the change that may make this Condition false
changee - the Process to which the change is to be applied
Returns:
boolean indicating whether or not application of the Change specified to the Process specified would make this Condition false.
Throws:
CanNotEvaluateConditionException

getProcessId

public com.oakgrovesystems.reactor.ReactorObjectId getProcessId()
returns the id of the process that must be in a particular state for this Condition to be true.

Returns:
the id of the process that must be in a particular state for this Condition to be true.

setProcessId

public void setProcessId(com.oakgrovesystems.reactor.ReactorObjectId processId)
sets the id of the process that must be in a particular state for this Condition to be true.

Parameters:
processId - the id of the process that must be in a particular state for this Condition to be true.

getState

public int getState()
returns the state a particular Process must be in for this Condition to be true.

Returns:
the state a particular Process must be in for this Condition to be true.

setState

public void setState(int state)
sets the state a particular Process must be in for this Condition to be true.

Parameters:
state - the state a particular Process must be in for this Condition to be true.

sameAs

public boolean sameAs(java.lang.Object o)
tests this ProcessStateEqualsCondition for content equality with another Object. Instances of different classes are not equal.

Specified by:
sameAs in interface ProcessCondition
Specified by:
sameAs in class AbstractProcessCondition
Parameters:
o - the object to which this object should be comapared.
Returns:
boolean indicating whether or not the objects are equal

copy

public com.oakgrovesystems.reactor.processMediation.ProcessCondition copy()
Clones this ProcessStateEqualsConditons. This method is identical to clone()

Specified by:
copy in interface ProcessCondition
Specified by:
copy in class AbstractProcessCondition
Returns:
the clone

clone

public java.lang.Object clone()
Clones this ProcessStateEqualsConditons. This method is identical to copy()

Overrides:
clone in class java.lang.Object
Returns:
the clone


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