|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Describes an instance of a type within the model. Each instance is specified by its {link de.tuberlin.cs.cis.ocl.model.check.ClassifierDescriptor classifier}. An instance must therefore define all properties declared by the classifier and its supertypes. This especially includes the predefined supertypes within the OCL-context.
ClassifierDescriptor
,
OCL 1.5 StandardMethod Summary | |
InstanceDescriptor |
cast(ClassifierDescriptor type)
Casts the actual runtime type of this instance to the specified classifier. |
boolean |
equals(java.lang.Object modelInstanceDesc)
Returns true if the specified instance is equal to
this instance. |
java.lang.String |
getName()
Returns the name of this instance. |
OclAnyInstance |
getPredefinedParent()
Defines the predefined parent of this instance. |
InstanceDescriptor |
getValue(TypedProperty attribute)
Returns the value of the specified attribute. |
InstanceDescriptor |
invoke(TypedProperty operation,
InstanceDescriptor[] args)
Invokes an operation on this instance with the arguments args. |
boolean |
isInstanceOf(ClassifierDescriptor type,
boolean considerSubtype)
Determines if this instance is an instance of the specified type. |
boolean |
isInState(java.lang.String state)
Determines if this instance is in state state. |
InstanceDescriptor[] |
navigate(TypedAssociation association,
Instance[] qualifiers)
Navigates an association of this instance with the specified qualifiers. |
Method Detail |
public boolean isInState(java.lang.String state)
state
- a state described according to the OCL-Standard.
true
if this instance is in state state.ClassifierDescriptor.isStateDefined(java.lang.String)
public InstanceDescriptor cast(ClassifierDescriptor type) throws TypeCastException
type
- a supertype of this instance.
TypeCastException
- if this instance cannot be casted to the
specified type.public InstanceDescriptor invoke(TypedProperty operation, InstanceDescriptor[] args) throws FeatureInvocationException, UndefinedValueException
operation
- an operation defined through this instance's static type.args
- arguments that conform to the parameters of operation.
FeatureInvocationException
- if an exception occurs while invoking
the operation.
UndefinedValueException
- if the result of the invokation is undefined
(for example null).public InstanceDescriptor[] navigate(TypedAssociation association, Instance[] qualifiers) throws FeatureInvocationException, UndefinedValueException
association
- an association declared by the instance's classifier.qualifiers
- association qualifiers.
FeatureInvocationException
- if an exception occurs while navigating
the association.
UndefinedValueException
- if the result of the naviagtion is undefined
(for example null).public InstanceDescriptor getValue(TypedProperty attribute) throws FeatureInvocationException, UndefinedValueException
attribute
- an attribute of this instance.
FeatureInvocationException
- if an exception occurs while resolving
the value of the attribute.
UndefinedValueException
- if the value of the attribute is undefined.public OclAnyInstance getPredefinedParent()
null
if
the default parent should be used.public boolean equals(java.lang.Object modelInstanceDesc)
true
if the specified instance is equal to
this instance. The result is used to implement the operations
OclAny.= and OclAny.<>.
equals
in class java.lang.Object
modelInstanceDesc
- an instance (!= null)
true
if the specified instance is equal to
this instance, false
otherwise.public java.lang.String getName()
public boolean isInstanceOf(ClassifierDescriptor type, boolean considerSubtype)
true
) one of
its subtypes. The result is then used to define the operations
OclAny.oclIsKindOf(OclType) and OclAny.isTypeOf(OclType).
type
- a model classifierconsiderSubtype
- determines if subtypes should also be considered.
true
if this instance is a subtype of the specified
type, false
otherwise.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |