org.eclipse.uml2
Interface Operation

All Superinterfaces:
BehavioralFeature, Element, EModelElement, EObject, Feature, MultiplicityElement, NamedElement, Namespace, Notifier, ParameterableElement, RedefinableElement, TemplateableElement, TypedElement

public interface Operation
extends BehavioralFeature, TypedElement, MultiplicityElement, ParameterableElement

A representation of the model object 'Operation'. An operation is a behavioral feature of a classifier that specifies the name, type, parameters, and constraints for invoking an associated behavior.

The following features are supported:

See Also:
UML2Package.getOperation()

Field Summary
static String copyright
           
 
Fields inherited from interface org.eclipse.uml2.NamedElement
SEPARATOR
 
Fields inherited from interface org.eclipse.uml2.MultiplicityElement
UNLIMITED_UPPER_BOUND
 
Method Summary
 Parameter createOwnedParameter(EClass eClass)
          Creates a Parameter and appends it to the 'Owned Parameter' containment reference list
 Constraint getBodyCondition()
          Returns the value of the 'Body Condition' reference
 Class getClass_()
          Returns the value of the 'Class ' container reference.
 DataType getDatatype()
          Returns the value of the 'Datatype' container reference.
 EList getFeaturingClassifiers()
           
 EList getFormalParameters()
           
 int getLower()
           
 Namespace getNamespace()
           
 EList getOwnedMembers()
           
 Parameter getOwnedParameter(String unqualifiedName)
          Retrieves the Parameter with the specified name from the 'Owned Parameter' containment reference list
 EList getOwnedParameters()
          Returns the value of the 'Owned Parameter' containment reference list.
 EList getOwnedRules()
           
 Constraint getPostcondition(String unqualifiedName)
          Retrieves the Constraint with the specified name from the 'Postcondition' reference list
 EList getPostconditions()
          Returns the value of the 'Postcondition' reference list.
 Constraint getPrecondition(String unqualifiedName)
          Retrieves the Constraint with the specified name from the 'Precondition' reference list
 EList getPreconditions()
          Returns the value of the 'Precondition' reference list.
 EList getRaisedExceptions()
           
 EList getRedefinedElements()
           
 Operation getRedefinedOperation(String unqualifiedName)
          Retrieves the Operation with the specified name from the 'Redefined Operation' reference list
 EList getRedefinedOperations()
          Returns the value of the 'Redefined Operation' reference list.
 EList getRedefinitionContexts()
           
 Type getType()
           
 int getUpper()
           
 boolean isConsistentWith(RedefinableElement redefinee)
           A query based on the following OCL expression: (redefinee.oclIsKindOf(Operation) and let op: Operation = redefinee.oclAsType(Operation) in self.formalParameter.size() = op.formalParameter.size() and self.returnResult.size() = op.returnResult.size() and forAll(i | op.formalParameter[i].type.conformsTo(self.formalParameter[i].type)) and forAll(i | op.returnResult[i].type.conformsTo(self.returnResult[i].type)) )
 boolean isOrdered()
           A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().isOrdered else false endif
 boolean isQuery()
          Returns the value of the 'Is Query' attribute.
 boolean isUnique()
           A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().isUnique else true endif
 int lower()
           A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().lower else Set{} endif
 void setBodyCondition(Constraint value)
          Sets the value of the 'Body Condition' reference
 void setClass_(Class value)
          Sets the value of the 'Class ' container reference
 void setDatatype(DataType value)
          Sets the value of the 'Datatype' container reference
 void setIsOrdered(boolean value)
           
 void setIsQuery(boolean value)
          Sets the value of the 'Is Query' attribute
 void setIsUnique(boolean value)
           
 void setType(Type value)
           
 Classifier type()
           A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().type else Set{} endif
 int upper()
           A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().upper else Set{} endif
 boolean validateOnlyBodyForQuery(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: bodyCondition->notEmpty() implies isQuery
 boolean validateTypeOfResult(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: if returnResult->size() = 1 then type = returnResult.type else type = nil endif
 
Methods inherited from interface org.eclipse.uml2.BehavioralFeature
createFormalParameter, createReturnResult, getConcurrency, getFormalParameter, getMembers, getMethod, getMethods, getParameter, getParameters, getRaisedException, getReturnResult, getReturnResults, isAbstract, isDistinguishableFrom, setConcurrency, setIsAbstract
 
Methods inherited from interface org.eclipse.uml2.Namespace
createElementImport, createOwnedRule, createPackageImport, excludeCollisions, getElementImports, getImportedMember, getImportedMembers, getImportedPackages, getMember, getNamesOfMember, getOwnedElements, getOwnedRule, getPackageImports, importedMember, importElement, importMembers, importPackage, membersAreDistinguishable, validateImportedMemberDerived, validateMembersAreDistinguishable
 
Methods inherited from interface org.eclipse.uml2.NamedElement
allNamespaces, createNameExpression, getClientDependencies, getClientDependency, getName, getNameExpression, getOwner, getQualifiedName, getVisibility, qualifiedName, separator, setName, setNameExpression, setVisibility, validateNoName, validateQualifiedName, validateVisibilityNeedsOwnership
 
Methods inherited from interface org.eclipse.uml2.TemplateableElement
createOwnedTemplateSignature, createTemplateBinding, getOwnedTemplateSignature, getTemplateBindings, parameterableElements, setOwnedTemplateSignature
 
Methods inherited from interface org.eclipse.uml2.Element
addKeyword, allOwnedElements, apply, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedVersion, getKeywords, getModel, getNearestPackage, getOwnedComments, getValue, hasKeyword, isApplied, isRequired, mustBeOwned, removeKeyword, setValue, unapply, validateHasOwner, validateNotOwnSelf
 
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotation, getEAnnotations
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.uml2.Feature
getFeaturingClassifier, isStatic, setIsStatic
 
Methods inherited from interface org.eclipse.uml2.RedefinableElement
getRedefinitionContext, isLeaf, isRedefinitionContextValid, setIsLeaf, validateRedefinitionConsistent, validateRedefinitionContextValid
 
Methods inherited from interface org.eclipse.uml2.MultiplicityElement
createLowerValue, createUpperValue, getLowerValue, getOwnedElements, getUpperValue, includesCardinality, includesMultiplicity, isMultivalued, lowerBound, setLowerBound, setLowerValue, setUpperBound, setUpperValue, upperBound, validateLowerEqLowerbound, validateLowerGe0, validateUpperEqUpperbound, validateUpperGeLower, validateUpperGt0
 
Methods inherited from interface org.eclipse.uml2.ParameterableElement
getOwner, getOwningParameter, getTemplateParameter, setOwningParameter, setTemplateParameter
 

Field Detail

copyright

public static final String copyright

See Also:
Constant Field Values
Method Detail

isQuery

public boolean isQuery()
Returns the value of the 'Is Query' attribute. The default value is "false".

If the meaning of the 'Is Query' attribute isn't clear, there really should be more of a description here...

Specifies whether an execution of the BehavioralFeature leaves the state of the system unchanged (isQuery=true) or whether side effects may occur (isQuery=false). The default value is false.

Returns:
the value of the 'Is Query' attribute.
See Also:
setIsQuery(boolean), UML2Package.getOperation_IsQuery()

setIsQuery

public void setIsQuery(boolean value)
Sets the value of the 'Is Query' attribute.

Parameters:
value - the new value of the 'Is Query' attribute.
See Also:
isQuery()

getOwnedParameters

public EList getOwnedParameters()
Returns the value of the 'Owned Parameter' containment reference list. The list contents are of type Parameter. It is bidirectional and its opposite is 'Operation'.

If the meaning of the 'Owned Parameter' containment reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Owned Parameter' containment reference list.
See Also:
UML2Package.getOperation_OwnedParameter(), Parameter.getOperation()

getOwnedParameter

public Parameter getOwnedParameter(String unqualifiedName)
Retrieves the Parameter with the specified name from the 'Owned Parameter' containment reference list.

Parameters:
unqualifiedName - The unqualified name of the Parameter to retrieve.
Returns:
The Parameter with the specified name, or null.
See Also:
getOwnedParameters()

createOwnedParameter

public Parameter createOwnedParameter(EClass eClass)
Creates a Parameter and appends it to the 'Owned Parameter' containment reference list.

Parameters:
eClass - The Ecore class of the Parameter to create.
Returns:
The new Parameter.
See Also:
getOwnedParameters()

getClass_

public Class getClass_()
Returns the value of the 'Class ' container reference. It is bidirectional and its opposite is 'Owned Operation'.

If the meaning of the 'Class ' container reference isn't clear, there really should be more of a description here...

Returns:
the value of the 'Class ' container reference.
See Also:
setClass_(org.eclipse.uml2.Class), UML2Package.getOperation_Class_(), Class.getOwnedOperations()

setClass_

public void setClass_(Class value)
Sets the value of the 'Class ' container reference.

Parameters:
value - the new value of the 'Class ' container reference.
See Also:
getClass_()

getDatatype

public DataType getDatatype()
Returns the value of the 'Datatype' container reference. It is bidirectional and its opposite is 'Owned Operation'.

If the meaning of the 'Datatype' container reference isn't clear, there really should be more of a description here...

Returns:
the value of the 'Datatype' container reference.
See Also:
setDatatype(DataType), UML2Package.getOperation_Datatype(), DataType.getOwnedOperations()

setDatatype

public void setDatatype(DataType value)
Sets the value of the 'Datatype' container reference.

Parameters:
value - the new value of the 'Datatype' container reference.
See Also:
getDatatype()

getPreconditions

public EList getPreconditions()
Returns the value of the 'Precondition' reference list. The list contents are of type Constraint.

If the meaning of the 'Precondition' containment reference list isn't clear, there really should be more of a description here...

An optional set of Constraints on the state of the system when the Operation is invoked. Subsets Namespace::ownedMember.

Returns:
the value of the 'Precondition' reference list.
See Also:
UML2Package.getOperation_Precondition()

getPrecondition

public Constraint getPrecondition(String unqualifiedName)
Retrieves the Constraint with the specified name from the 'Precondition' reference list.

Parameters:
unqualifiedName - The unqualified name of the Constraint to retrieve.
Returns:
The Constraint with the specified name, or null.
See Also:
getPreconditions()

getPostconditions

public EList getPostconditions()
Returns the value of the 'Postcondition' reference list. The list contents are of type Constraint.

If the meaning of the 'Postcondition' containment reference list isn't clear, there really should be more of a description here...

An optional set of Constraints specifying the state of the system when the Operation is completed. Subsets Namespace::ownedMember.

Returns:
the value of the 'Postcondition' reference list.
See Also:
UML2Package.getOperation_Postcondition()

getPostcondition

public Constraint getPostcondition(String unqualifiedName)
Retrieves the Constraint with the specified name from the 'Postcondition' reference list.

Parameters:
unqualifiedName - The unqualified name of the Constraint to retrieve.
Returns:
The Constraint with the specified name, or null.
See Also:
getPostconditions()

getRedefinedOperations

public EList getRedefinedOperations()
Returns the value of the 'Redefined Operation' reference list. The list contents are of type Operation.

If the meaning of the 'Redefined Operation' reference list isn't clear, there really should be more of a description here...

the Operations that are redefined by this Operation. Subsets RedefinableElement. redefinedElement.

Returns:
the value of the 'Redefined Operation' reference list.
See Also:
UML2Package.getOperation_RedefinedOperation()

getRedefinedOperation

public Operation getRedefinedOperation(String unqualifiedName)
Retrieves the Operation with the specified name from the 'Redefined Operation' reference list.

Parameters:
unqualifiedName - The unqualified name of the Operation to retrieve.
Returns:
The Operation with the specified name, or null.
See Also:
getRedefinedOperations()

getBodyCondition

public Constraint getBodyCondition()
Returns the value of the 'Body Condition' reference.

If the meaning of the 'Body Condition' containment reference isn't clear, there really should be more of a description here...

optional Constraint on the result values of an invocation of this Operation. Subsets Namespace::ownedMember.

Returns:
the value of the 'Body Condition' reference.
See Also:
setBodyCondition(Constraint), UML2Package.getOperation_BodyCondition()

setBodyCondition

public void setBodyCondition(Constraint value)
Sets the value of the 'Body Condition' reference.

Parameters:
value - the new value of the 'Body Condition' reference.
See Also:
getBodyCondition()

validateTypeOfResult

public boolean validateTypeOfResult(DiagnosticChain diagnostics,
                                    Map context)
An invariant constraint based on the following OCL expression: if returnResult->size() = 1 then type = returnResult.type else type = nil endif


isOrdered

public boolean isOrdered()
A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().isOrdered else false endif

Specified by:
isOrdered in interface MultiplicityElement
Returns:
the value of the 'Is Ordered' attribute.
See Also:
MultiplicityElement.setIsOrdered(boolean), UML2Package.getMultiplicityElement_IsOrdered()

isUnique

public boolean isUnique()
A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().isUnique else true endif

Specified by:
isUnique in interface MultiplicityElement
Returns:
the value of the 'Is Unique' attribute.
See Also:
MultiplicityElement.setIsUnique(boolean), UML2Package.getMultiplicityElement_IsUnique()

lower

public int lower()
A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().lower else Set{} endif

Specified by:
lower in interface MultiplicityElement

upper

public int upper()
A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().upper else Set{} endif

Specified by:
upper in interface MultiplicityElement

type

public Classifier type()
A query based on the following OCL expression: if returnResult->size() = 1 then returnResult->any().type else Set{} endif


validateOnlyBodyForQuery

public boolean validateOnlyBodyForQuery(DiagnosticChain diagnostics,
                                        Map context)
An invariant constraint based on the following OCL expression: bodyCondition->notEmpty() implies isQuery


isConsistentWith

public boolean isConsistentWith(RedefinableElement redefinee)
A query based on the following OCL expression: (redefinee.oclIsKindOf(Operation) and let op: Operation = redefinee.oclAsType(Operation) in self.formalParameter.size() = op.formalParameter.size() and self.returnResult.size() = op.returnResult.size() and forAll(i | op.formalParameter[i].type.conformsTo(self.formalParameter[i].type)) and forAll(i | op.returnResult[i].type.conformsTo(self.returnResult[i].type)) )

Specified by:
isConsistentWith in interface RedefinableElement

setIsOrdered

public void setIsOrdered(boolean value)

Specified by:
setIsOrdered in interface MultiplicityElement
Parameters:
value - the new value of the 'Is Ordered' attribute.
See Also:
MultiplicityElement.isOrdered()

setIsUnique

public void setIsUnique(boolean value)

Specified by:
setIsUnique in interface MultiplicityElement
Parameters:
value - the new value of the 'Is Unique' attribute.
See Also:
MultiplicityElement.isUnique()

getLower

public int getLower()

Specified by:
getLower in interface MultiplicityElement
Returns:
the value of the 'Lower' attribute.
See Also:
UML2Package.getMultiplicityElement_Lower()

getUpper

public int getUpper()

Specified by:
getUpper in interface MultiplicityElement
Returns:
the value of the 'Upper' attribute.
See Also:
UML2Package.getMultiplicityElement_Upper()

getRaisedExceptions

public EList getRaisedExceptions()

Specified by:
getRaisedExceptions in interface BehavioralFeature
Returns:
the value of the 'Raised Exception' reference list.
See Also:
UML2Package.getBehavioralFeature_RaisedException()

getFormalParameters

public EList getFormalParameters()

Specified by:
getFormalParameters in interface BehavioralFeature
Returns:
the value of the 'Formal Parameter' containment reference list.
See Also:
UML2Package.getBehavioralFeature_FormalParameter()

getType

public Type getType()

Specified by:
getType in interface TypedElement
Returns:
the value of the 'Type' reference.
See Also:
TypedElement.setType(Type), UML2Package.getTypedElement_Type()

setType

public void setType(Type value)

Specified by:
setType in interface TypedElement
Parameters:
value - the new value of the 'Type' reference.
See Also:
TypedElement.getType()

getRedefinitionContexts

public EList getRedefinitionContexts()

Specified by:
getRedefinitionContexts in interface RedefinableElement
Returns:
the value of the 'Redefinition Context' reference list.
See Also:
UML2Package.getRedefinableElement_RedefinitionContext()

getNamespace

public Namespace getNamespace()

Specified by:
getNamespace in interface NamedElement

getFeaturingClassifiers

public EList getFeaturingClassifiers()

Specified by:
getFeaturingClassifiers in interface Feature
Returns:
the value of the 'Featuring Classifier' reference list.
See Also:
UML2Package.getFeature_FeaturingClassifier(), Classifier.getFeatures()

getOwnedMembers

public EList getOwnedMembers()

Specified by:
getOwnedMembers in interface BehavioralFeature

getOwnedRules

public EList getOwnedRules()

Specified by:
getOwnedRules in interface Namespace
Returns:
the value of the 'Owned Rule' containment reference list.
See Also:
UML2Package.getNamespace_OwnedRule(), Constraint.getNamespace()

getRedefinedElements

public EList getRedefinedElements()

Specified by:
getRedefinedElements in interface RedefinableElement

Copyright 2003, 2004 IBM Corporation and others.
All Rights Reserved.