de.tuberlin.cs.cis.ocl.eval.instance
Interface Instance

All Known Implementing Classes:
PredefinedInstance

public interface Instance

Abstracts and represents instances for the evaluation proccess. Differences between objects of the model and predefined instances are hidden from the evaluation. The interface provides uniform means to access the runtime type, the value and defined properties of the instance.

Author:
fchabar

Method Summary
 Type getRuntimeType()
          Returns the OCL runtime type of this instance.
 Instance getValue(Property attr)
          Returns the value of an attribut of this instance.
 Instance invoke(Property op, Instance[] args)
          Invokes an operation on this instance.
 Instance navigate(Property assoc, Instance[] qualifiers)
          Navigates an association of this instance.
 

Method Detail

invoke

public Instance invoke(Property op,
                       Instance[] args)
                throws FeatureInvocationException,
                       UndefinedValueException
Invokes an operation on this instance.

Parameters:
op - the operation to invoke
args - the arguments the operation is called with
Returns:
the return value of the invokation
Throws:
FeatureInvocationException - thrown if an exception occurs during the property call.
UndefinedValueException - thrown if the specified feature is undefined on this instance.

navigate

public Instance navigate(Property assoc,
                         Instance[] qualifiers)
                  throws FeatureInvocationException,
                         UndefinedValueException
Navigates an association of this instance.

Parameters:
assoc - the association to navigate
qualifiers - the evaluated denotation the navigation is qualified with.
Returns:
the navigated instance
Throws:
FeatureInvocationException - thrown if an exception occurs during the property call.
UndefinedValueException - thrown if the specified feature is undefined on this instance.

getValue

public Instance getValue(Property attr)
                  throws FeatureInvocationException,
                         UndefinedValueException
Returns the value of an attribut of this instance.

Parameters:
attr - the attribute to access
Returns:
the value of the accessed attribute
Throws:
FeatureInvocationException - thrown if an exception occurs during the property call.
UndefinedValueException - thrown if the specified feature is undefined on this instance.

getRuntimeType

public Type getRuntimeType()
Returns the OCL runtime type of this instance.

Returns:
the OCL runtime type of this instance.