|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is implemented by those classes of the library representing
Predefined OCL Types, and is therefore the return type of all factory
methods in Ocl
and OclFactory
.
OclRoot
defines operations available for all
Predefined Types, i.e. tests for equality, definedness and the operation
getFeature
.
getFeature(String s)
Method Summary | |
OclRoot |
getFeature(String name)
The operation getFeature represents both the query of
a property of an application object and the shorthand for collect,
depending on the implementing class. |
OclCollection |
getFeatureAsCollection(String name)
OCL allows to treat association ends of maximal multiplicity one as Sets. |
String |
getUndefinedReason()
Returns the reason, why this undefined ocl object has been created. |
OclBoolean |
isEqualTo(Object o)
Returns true if this object is equal to the object given as parameter. |
OclBoolean |
isNotEqualTo(Object o)
Returns the negated result of isEqualTo . |
boolean |
isUndefined()
Returns true if this object is the result of an undefined OCL expression. |
Method Detail |
public OclRoot getFeature(String name)
getFeature
represents both the query of
a property of an application object and the shorthand for collect,
depending on the implementing class. This is to faciliate Java code
generation in the case of an OCL expression like "expr.property",
where it is not possible to decide without model information if
"expr" denotes a Set or Bag, making the result of the expression
(that is then the shorthand notation for collect)
a Bag, or is it denotes a single object, making the result a Set or
some other object. In both cases, a call to this method will be
the correct transformation to Java.
name
- the name of the queried attributeOclCollection.collect(OclIterator iter, OclRootEvaluatable eval)
public OclCollection getFeatureAsCollection(String name)
This method should be called instead of getFeature
whenever a collection operation, easily recognizable by the "->
", is applied to the result of a subexpression. It is implemented
in OclCollection
, OclAny
and
OclContainer
to call
getFeature
and check if the result is an instance of
OclCollection
. If it is, it just returns the result; if
not, a new OclCollection
containing only that result is
returned.
getFeature(String s)
public OclBoolean isEqualTo(Object o)
==
, not
equal
).
public OclBoolean isNotEqualTo(Object o)
isEqualTo
.
isEqualTo(Object o)
public boolean isUndefined()
public String getUndefinedReason()
RuntimeException
- if the onject is not undefined
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |