org.infolayer.ocl
Class OclExpression

java.lang.Object
  extended byorg.infolayer.ocl.OclExpression
All Implemented Interfaces:
Evaluable
Direct Known Subclasses:
AsCollectionExp, CollectionLiteralExp, IfExp, InStateExp, IterateExp, IteratorExp, LetExp, LiteralExp, OclAsTypeExp, OclRoot, OperationCallExp, PropertyExp, TupleLiteralExp, TuplePropertyExp, VarDef

public abstract class OclExpression
extends java.lang.Object
implements Evaluable


Field Summary
static java.util.logging.Logger SQL_LOGGER
           
static int SQL_MATCH
           
static int SQL_MAY_GENERALIZE
           
static int SQL_MAY_SPECIALIZE
           
 
Constructor Summary
OclExpression()
           
 
Method Summary
abstract  OclExpression clone(OclExpression[] dep)
          required for resolve
abstract  java.lang.Object eval(Bindings objects)
           
abstract  OclExpression getDependency(int i)
          required for conversion to sql expression, includes "base"
abstract  int getDependencyCount()
          required for conversion to sql expression
 java.lang.String getName()
           
abstract  UmlClassifier getType()
           
 boolean isConstant()
          Returns true if this is a constant operation and all dependencies are constant.
 boolean isQuery()
          Returns always true sinc Ocl Operations are always query operations.
 boolean isResolvable(int var)
           
 OclExpression resolve(Bindings context, VarDef iterator)
          replaces variables with constants from context, except for the iterator.
 OclExpression simplify()
           
 java.lang.String toSql(int mode, java.util.Map propertyMap)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SQL_LOGGER

public static final java.util.logging.Logger SQL_LOGGER

SQL_MAY_GENERALIZE

public static final int SQL_MAY_GENERALIZE
See Also:
Constant Field Values

SQL_MAY_SPECIALIZE

public static final int SQL_MAY_SPECIALIZE
See Also:
Constant Field Values

SQL_MATCH

public static final int SQL_MATCH
See Also:
Constant Field Values
Constructor Detail

OclExpression

public OclExpression()
Method Detail

getType

public abstract UmlClassifier getType()
Specified by:
getType in interface Evaluable

isConstant

public boolean isConstant()
Returns true if this is a constant operation and all dependencies are constant.


isQuery

public boolean isQuery()
Returns always true sinc Ocl Operations are always query operations.

Specified by:
isQuery in interface Evaluable

isResolvable

public boolean isResolvable(int var)

simplify

public OclExpression simplify()

getName

public java.lang.String getName()

resolve

public OclExpression resolve(Bindings context,
                             VarDef iterator)
replaces variables with constants from context, except for the iterator. May throw a RuntimeException if not supported. This is used by EvalIterative. Please note that the iterator index is changed to 0.


getDependency

public abstract OclExpression getDependency(int i)
required for conversion to sql expression, includes "base"


clone

public abstract OclExpression clone(OclExpression[] dep)
required for resolve


getDependencyCount

public abstract int getDependencyCount()
required for conversion to sql expression


toString

public java.lang.String toString()

toSql

public java.lang.String toSql(int mode,
                              java.util.Map propertyMap)

eval

public abstract java.lang.Object eval(Bindings objects)
Specified by:
eval in interface Evaluable