OclAny

OclAny

The number of elements in the collection self.essions. OclAny is itself an instance of the metatype AnyType.

All classes in a UML model inherit all operations defined on OclAny. To avoid name conflicts between properties in the model and the properties inherited from OclAny, all names on the properties of OclAny start with ‘ocl.’ Although theoretically there may still be name conflicts, they can be avoided. One can also use qualification by OclAny (name of the type) to explicitly refer to the OclAny properties.

Operations of OclAny, where the instance of OclAny is called object.

Operations

=(object2 : OclSelf[?]) : Boolean[1] precedence: EQUALITY

True if self is the same object as object2. Infix operator.

post: result = self = object2

<>(object2 : OclSelf[?]) : Boolean[1] precedence: EQUALITY

True if self is a different object from object2. Infix operator.

post: result = not (self = object2)

oclAsSet() : Set(OclSelf[*|1])

Returns a Set with self as the sole content, unless self is null in which case returns an empty set,

oclAsType(TT)(type : TT[?]) : TT[1] invalidating

Evaluates to self, where self is of the type identified by T. The type T may be any classifier defined in the UML model; if the actual type of self at evaluation time does not conform to T, then the oclAsType operation evaluates to invalid.

In the case of feature redefinition, casting an object to a supertype of its actual type does not access the supertype’s definition of the feature; according to the semantics of redefinition, the redefined feature simply does not exist for the object. However, when casting to a supertype, any features additionally defined by the subtype are suppressed.

post IsSelf: result = self

oclIsInState(statespec : OclState[?]) : Boolean[1]

Evaluates to true if the self is in the state identified by statespec.

oclIsInvalid() : Boolean[1] validating

Evaluates to true if the self is equal to OclInvalid.

oclIsKindOf(type : OclType[?]) : Boolean[1]

Evaluates to true if the type of self conforms to t. That is, self is of type t or a subtype of t.

oclIsNew() : Boolean[1]

Can only be used in a postcondition. Evaluates to true if the self is created during performing the operation (for instance, it didn’t exist at precondition time).

oclIsTypeOf(type : OclType[?]) : Boolean[1]

Evaluates to true if self is of the type t but not a subtype of t

oclIsUndefined() : Boolean[1] validating

Evaluates to true if the self is equal to invalid or equal to null.

oclLog() : OclSelf[?]

Evaluates to the self, with the side effect of generating a log message comprising self.

oclLog(message : String[?]) : OclSelf[?]

Evaluates to the self, with the side effect of generating a log message comprising message followed by self.

oclType() : OclSelf[1]

Evaluates to the type of which self is an instance.

toString() : String[1]

Returns a string representation of self.