com.monad.homerun.model
Class Relation

java.lang.Object
  extended by com.monad.homerun.model.Relation
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DateRelation, NumericRelation, ScalarRelation, SetRelation, StateRelation, TimeRelation

public abstract class Relation
extends java.lang.Object
implements java.io.Serializable

Relation is an abstract base class used to describe a relationship between a model's value and another value that holds (true or false) with respect to a given object or objects. Relations are used in Rule conditions, Filter screens, and Functions.

See Also:
Serialized Form

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

Constructor Detail

Relation

public Relation()

Relation

public Relation(java.lang.String domain,
                java.lang.String modelName,
                int operator)

Relation

public Relation(Relation rel)
Method Detail

getDomain

public java.lang.String getDomain()
Returns the domain of the model

Returns:
the model domain

getModelName

public java.lang.String getModelName()
Returns the model name

Returns:
the model name

getOperator

public int getOperator()
Returns the relation operator

Returns:
the operator

toString

public java.lang.String toString()
Returns a string representation of the relation

Overrides:
toString in class java.lang.Object
Returns:
relation as a string

validate

public abstract boolean validate(Relator relator,
                                 Trace trace)
Validates the terms of the relation with optional tracing

Parameters:
relator - - the entity performing the relation comparison
trace - - optional trace object
Returns:
true if relation is valid, otherwise false

holds

public abstract boolean holds(java.lang.String objectName,
                              java.lang.String compObjName,
                              Relator relator,
                              Trace trace)
                       throws NoResourceException
Throws:
NoResourceException

getValue

public abstract java.lang.String getValue()

copy

public abstract Relation copy()

isObservable

public boolean isObservable(Relator relator,
                            java.lang.String objectName)


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