com.monad.homerun.model.state
Class StateRelation

java.lang.Object
  extended by com.monad.homerun.model.Relation
      extended by com.monad.homerun.model.state.StateRelation
All Implemented Interfaces:
java.io.Serializable

public class StateRelation
extends Relation

StateRelation extends Relation to describe a model state. That is, the relation holds if the specifed object model is in the specified state.

See Also:
Serialized Form

Constructor Summary
StateRelation()
           
StateRelation(StateRelation stateRel)
           
StateRelation(java.lang.String domain, java.lang.String modelName, int relation, java.lang.String stateName)
           
 
Method Summary
 Relation copy()
           
 java.lang.String getStateName()
           
 java.lang.String getValue()
           
 boolean holds(java.lang.String objectName, java.lang.String compObjName, Relator relator, Trace trace)
           
 java.lang.String toString()
          Returns a string representation of the relation
 boolean validate(Relator relator, Trace trace)
          Validates the terms of the relation with optional tracing
 
Methods inherited from class com.monad.homerun.model.Relation
getDomain, getModelName, getOperator, isObservable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateRelation

public StateRelation()

StateRelation

public StateRelation(java.lang.String domain,
                     java.lang.String modelName,
                     int relation,
                     java.lang.String stateName)

StateRelation

public StateRelation(StateRelation stateRel)
Method Detail

copy

public Relation copy()
Specified by:
copy in class Relation

getStateName

public java.lang.String getStateName()

toString

public java.lang.String toString()
Description copied from class: Relation
Returns a string representation of the relation

Overrides:
toString in class Relation
Returns:
relation as a string

validate

public boolean validate(Relator relator,
                        Trace trace)
Description copied from class: Relation
Validates the terms of the relation with optional tracing

Specified by:
validate in class Relation
Parameters:
relator - - the entity performing the relation comparison
trace - - optional trace object
Returns:
true if relation is valid, otherwise false

holds

public boolean holds(java.lang.String objectName,
                     java.lang.String compObjName,
                     Relator relator,
                     Trace trace)
              throws NoResourceException
Specified by:
holds in class Relation
Throws:
NoResourceException

getValue

public java.lang.String getValue()
Specified by:
getValue in class Relation


Copyright © 2006-2009 Richard Rodgers. All Rights Reserved.