org.eclipse.uml2.uml
Interface Operation

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

public interface Operation
extends BehavioralFeature, ParameterableElement, TemplateableElement

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. An operation may invoke both the execution of method behaviors as well as other behavioral responses. Operation specializes TemplateableElement in order to support specification of template operations and bound operations. Operation specializes ParameterableElement to specify that an operation can be exposed as a formal template parameter, and provided as an actual parameter in a binding of a template.

The following features are supported:

See Also:
UMLPackage.getOperation()

Field Summary
 
Fields inherited from interface org.eclipse.uml2.uml.NamedElement
SEPARATOR
 
Method Summary
 Constraint createBodyCondition(String name)
          Creates a new Constraint,with the specified 'Name', and sets the 'Body Condition' reference
 Constraint createBodyCondition(String name, EClass eClass)
          Creates a new Constraint, with the specified 'Name', and sets the 'Body Condition' reference
 Constraint createPostcondition(String name)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Postcondition' reference list
 Constraint createPostcondition(String name, EClass eClass)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Postcondition' reference list
 Constraint createPrecondition(String name)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Precondition' reference list
 Constraint createPrecondition(String name, EClass eClass)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Precondition' 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.
 Interface getInterface()
          Returns the value of the 'Interface' container reference.
 int getLower()
          Returns the value of the 'Lower' attribute.
 Constraint getPostcondition(String name)
          Retrieves the first Constraint with the specified 'Name' from the 'Postcondition' reference list
 Constraint getPostcondition(String name, boolean ignoreCase, EClass eClass, boolean createOnDemand)
          Retrieves the first Constraint with the specified 'Name' from the 'Postcondition' reference list
 EList getPostconditions()
          Returns the value of the 'Postcondition' reference list.
 Constraint getPrecondition(String name)
          Retrieves the first Constraint with the specified 'Name' from the 'Precondition' reference list
 Constraint getPrecondition(String name, boolean ignoreCase, EClass eClass, boolean createOnDemand)
          Retrieves the first Constraint with the specified 'Name' from the 'Precondition' reference list
 EList getPreconditions()
          Returns the value of the 'Precondition' reference list.
 Operation getRedefinedOperation(String name, EList ownedParameterNames, EList ownedParameterTypes)
          Retrieves the first Operation with the specified 'Name', 'Owned Parameter Names', and 'Owned Parameter Types' from the 'Redefined Operation' reference list
 Operation getRedefinedOperation(String name, EList ownedParameterNames, EList ownedParameterTypes, boolean ignoreCase)
          Retrieves the first Operation with the specified 'Name', 'Owned Parameter Names', and 'Owned Parameter Types' from the 'Redefined Operation' reference list
 EList getRedefinedOperations()
          Returns the value of the 'Redefined Operation' reference list.
 Parameter getReturnResult()
           Retrieves the (only) return result parameter for this operation
 Type getType()
          Returns the value of the 'Type' reference
 int getUpper()
          Returns the value of the 'Upper' attribute.
 boolean isOrdered()
          Returns the value of the 'Is Ordered' attribute.
 boolean isQuery()
          Returns the value of the 'Is Query' attribute.
 boolean isUnique()
          Returns the value of the 'Is Unique' attribute.
 int lowerBound()
           If this operation has a return parameter, lower equals the value of lower for that parameter.
 EList returnResult()
           The query returnResult() returns the set containing the return parameter of the Operation if one exists, otherwise, it returns an empty set result = ownedParameter->select (par | par.direction = #return)
 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 setInterface(Interface value)
          Sets the value of the 'Interface' container reference
 void setIsOrdered(boolean value)
          Sets the value of the 'Is Ordered' attribute
 void setIsQuery(boolean value)
          Sets the value of the 'Is Query' attribute
 void setIsUnique(boolean value)
          Sets the value of the 'Is Unique' attribute
 void setLower(int value)
          Sets the value of the 'Lower' attribute
 void setType(Type value)
          Sets the value of the 'Type' reference
 void setUpper(int value)
          Sets the value of the 'Upper' attribute
 int upperBound()
           If this operation has a return parameter, upper equals the value of upper for that parameter.
 boolean validateAtMostOneReturn(DiagnosticChain diagnostics, Map context)
           An operation can have at most one return parameter; i.e., an owned parameter with the direction set to 'return' self.ownedParameter->select(par | par.direction = #return)->size() <= 1
 boolean validateOnlyBodyForQuery(DiagnosticChain diagnostics, Map context)
           A bodyCondition can only be specified for a query operation.
 
Methods inherited from interface org.eclipse.uml2.uml.BehavioralFeature
createOwnedParameter, createOwnedParameterSet, createReturnResult, getConcurrency, getMethod, getMethod, getMethods, getOwnedParameter, getOwnedParameter, getOwnedParameters, getOwnedParameterSet, getOwnedParameterSet, getOwnedParameterSets, getRaisedException, getRaisedException, getRaisedExceptions, isAbstract, setConcurrency, setIsAbstract
 
Methods inherited from interface org.eclipse.uml2.uml.Namespace
createElementImport, createElementImport, createOwnedRule, createOwnedRule, createPackageImport, createPackageImport, excludeCollisions, getElementImport, getElementImport, getElementImports, getImportedElements, getImportedMember, getImportedMember, getImportedMembers, getImportedPackages, getMember, getMember, getMembers, getNamesOfMember, getOwnedMember, getOwnedMember, getOwnedMembers, getOwnedRule, getOwnedRule, getOwnedRules, getPackageImport, getPackageImport, getPackageImports, importMembers, membersAreDistinguishable, validateMembersDistinguishable
 
Methods inherited from interface org.eclipse.uml2.uml.NamedElement
allNamespaces, allOwningPackages, createDependency, createNameExpression, getClientDependencies, getClientDependency, getClientDependency, getLabel, getLabel, getName, getNameExpression, getNamespace, getQualifiedName, getVisibility, isDistinguishableFrom, isSetName, isSetVisibility, separator, setName, setNameExpression, setVisibility, unsetName, unsetVisibility, validateHasNoQualifiedName, validateHasQualifiedName, validateVisibilityNeedsOwnership
 
Methods inherited from interface org.eclipse.uml2.uml.Element
addKeyword, allOwnedElements, applyStereotype, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedSubstereotype, getAppliedSubstereotypes, getKeywords, getModel, getNearestPackage, getOwnedComments, getOwnedElements, getOwner, getRelationships, getRelationships, getRequiredStereotype, getRequiredStereotypes, getSourceDirectedRelationships, getSourceDirectedRelationships, getStereotypeApplication, getStereotypeApplications, getTargetDirectedRelationships, getTargetDirectedRelationships, getValue, hasKeyword, hasValue, isStereotypeApplicable, isStereotypeApplied, isStereotypeRequired, mustBeOwned, removeKeyword, setValue, unapplyStereotype, 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.uml.Feature
getFeaturingClassifier, getFeaturingClassifier, getFeaturingClassifiers, isStatic, setIsStatic
 
Methods inherited from interface org.eclipse.uml2.uml.RedefinableElement
getRedefinedElement, getRedefinedElement, getRedefinedElements, getRedefinitionContext, getRedefinitionContext, getRedefinitionContexts, isConsistentWith, isLeaf, isRedefinitionContextValid, setIsLeaf, validateRedefinitionConsistent, validateRedefinitionContextValid
 
Methods inherited from interface org.eclipse.uml2.uml.ParameterableElement
getOwningTemplateParameter, getTemplateParameter, isCompatibleWith, isTemplateParameter, setOwningTemplateParameter, setTemplateParameter
 
Methods inherited from interface org.eclipse.uml2.uml.TemplateableElement
createOwnedTemplateSignature, createOwnedTemplateSignature, createTemplateBinding, getOwnedTemplateSignature, getTemplateBinding, getTemplateBinding, getTemplateBindings, isTemplate, parameterableElements, setOwnedTemplateSignature
 

Method Detail

isQuery

public boolean isQuery()
Returns the value of the 'Is Query' attribute. The default value is "false". Specifies whether an execution of the BehavioralFeature leaves the state of the system unchanged (isQuery=true) or whether side effects may occur (isQuery=false).

Returns:
the value of the 'Is Query' attribute.
See Also:
Operation.setIsQuery(boolean), UMLPackage.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:
Operation.isQuery()

isOrdered

public boolean isOrdered()
Returns the value of the 'Is Ordered' attribute. The default value is "false". This information is derived from the return result for this Operation. Specifies whether the return parameter is ordered or not, if present.

Returns:
the value of the 'Is Ordered' attribute.
See Also:
Operation.setIsOrdered(boolean), UMLPackage.getOperation_IsOrdered()

setIsOrdered

public void setIsOrdered(boolean value)
Sets the value of the 'Is Ordered' attribute.

Parameters:
value - the new value of the 'Is Ordered' attribute.
See Also:
Operation.isOrdered()

isUnique

public boolean isUnique()
Returns the value of the 'Is Unique' attribute. The default value is "true". This information is derived from the return result for this Operation. Specifies whether the return parameter is unique or not, if present.

Returns:
the value of the 'Is Unique' attribute.
See Also:
Operation.setIsUnique(boolean), UMLPackage.getOperation_IsUnique()

setIsUnique

public void setIsUnique(boolean value)
Sets the value of the 'Is Unique' attribute.

Parameters:
value - the new value of the 'Is Unique' attribute.
See Also:
Operation.isUnique()

getLower

public int getLower()
Returns the value of the 'Lower' attribute. The default value is "1". This information is derived from the return result for this Operation. Specifies the lower multiplicity of the return parameter, if present.

Returns:
the value of the 'Lower' attribute.
See Also:
Operation.setLower(int), UMLPackage.getOperation_Lower()

setLower

public void setLower(int value)
Sets the value of the 'Lower' attribute.

Parameters:
value - the new value of the 'Lower' attribute.
See Also:
Operation.getLower()

getUpper

public int getUpper()
Returns the value of the 'Upper' attribute. The default value is "1". This information is derived from the return result for this Operation. Specifies the upper multiplicity of the return parameter, if present.

Returns:
the value of the 'Upper' attribute.
See Also:
Operation.setUpper(int), UMLPackage.getOperation_Upper()

setUpper

public void setUpper(int value)
Sets the value of the 'Upper' attribute.

Parameters:
value - the new value of the 'Upper' attribute.
See Also:
Operation.getUpper()

getClass_

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

Returns:
the value of the 'Class' container reference.
See Also:
Operation.setClass_(org.eclipse.uml2.uml.Class), UMLPackage.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:
Operation.getClass_()

getPreconditions

public EList getPreconditions()
Returns the value of the 'Precondition' reference list. The list contents are of type Constraint. An optional set of Constraints on the state of the system when the Operation is invoked.

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

createPrecondition

public Constraint createPrecondition(String name,
                                     EClass eClass)
Creates a new Constraint, with the specified 'Name', and appends it to the 'Precondition' reference list.

Parameters:
name - The 'Name' for the new Constraint, or null.
eClass - The Ecore class of the Constraint to create.
Returns:
The new Constraint.
See Also:
Operation.getPreconditions()

createPrecondition

public Constraint createPrecondition(String name)
Creates a new Constraint, with the specified 'Name', and appends it to the 'Precondition' reference list.

Parameters:
name - The 'Name' for the new Constraint, or null.
Returns:
The new Constraint.
See Also:
Operation.getPreconditions()

getPrecondition

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

Parameters:
name - The 'Name' of the Constraint to retrieve, or null.
Returns:
The first Constraint with the specified 'Name', or null.
See Also:
Operation.getPreconditions()

getPrecondition

public Constraint getPrecondition(String name,
                                  boolean ignoreCase,
                                  EClass eClass,
                                  boolean createOnDemand)
Retrieves the first Constraint with the specified 'Name' from the 'Precondition' reference list.

Parameters:
name - The 'Name' of the Constraint to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
eClass - The Ecore class of the Constraint to retrieve, or null.
createOnDemand - Whether to create a Constraint on demand if not found.
Returns:
The first Constraint with the specified 'Name', or null.
See Also:
Operation.getPreconditions()

getPostconditions

public EList getPostconditions()
Returns the value of the 'Postcondition' reference list. The list contents are of type Constraint. An optional set of Constraints specifying the state of the system when the Operation is completed.

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

createPostcondition

public Constraint createPostcondition(String name,
                                      EClass eClass)
Creates a new Constraint, with the specified 'Name', and appends it to the 'Postcondition' reference list.

Parameters:
name - The 'Name' for the new Constraint, or null.
eClass - The Ecore class of the Constraint to create.
Returns:
The new Constraint.
See Also:
Operation.getPostconditions()

createPostcondition

public Constraint createPostcondition(String name)
Creates a new Constraint, with the specified 'Name', and appends it to the 'Postcondition' reference list.

Parameters:
name - The 'Name' for the new Constraint, or null.
Returns:
The new Constraint.
See Also:
Operation.getPostconditions()

getPostcondition

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

Parameters:
name - The 'Name' of the Constraint to retrieve, or null.
Returns:
The first Constraint with the specified 'Name', or null.
See Also:
Operation.getPostconditions()

getPostcondition

public Constraint getPostcondition(String name,
                                   boolean ignoreCase,
                                   EClass eClass,
                                   boolean createOnDemand)
Retrieves the first Constraint with the specified 'Name' from the 'Postcondition' reference list.

Parameters:
name - The 'Name' of the Constraint to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
eClass - The Ecore class of the Constraint to retrieve, or null.
createOnDemand - Whether to create a Constraint on demand if not found.
Returns:
The first Constraint with the specified 'Name', or null.
See Also:
Operation.getPostconditions()

getRedefinedOperations

public EList getRedefinedOperations()
Returns the value of the 'Redefined Operation' reference list. The list contents are of type Operation. References the Operations that are redefined by this Operation.

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

getRedefinedOperation

public Operation getRedefinedOperation(String name,
                                       EList ownedParameterNames,
                                       EList ownedParameterTypes)
Retrieves the first Operation with the specified 'Name', 'Owned Parameter Names', and 'Owned Parameter Types' from the 'Redefined Operation' reference list.

Parameters:
name - The 'Name' of the Operation to retrieve, or null.
ownedParameterNames - The 'Owned Parameter Names' of the Operation to retrieve, or null.
ownedParameterTypes - The 'Owned Parameter Types' of the Operation to retrieve, or null.
Returns:
The first Operation with the specified 'Name', 'Owned Parameter Names', and 'Owned Parameter Types', or null.
See Also:
Operation.getRedefinedOperations()

getRedefinedOperation

public Operation getRedefinedOperation(String name,
                                       EList ownedParameterNames,
                                       EList ownedParameterTypes,
                                       boolean ignoreCase)
Retrieves the first Operation with the specified 'Name', 'Owned Parameter Names', and 'Owned Parameter Types' from the 'Redefined Operation' reference list.

Parameters:
name - The 'Name' of the Operation to retrieve, or null.
ownedParameterNames - The 'Owned Parameter Names' of the Operation to retrieve, or null.
ownedParameterTypes - The 'Owned Parameter Types' of the Operation to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
Returns:
The first Operation with the specified 'Name', 'Owned Parameter Names', and 'Owned Parameter Types', or null.
See Also:
Operation.getRedefinedOperations()

getDatatype

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

Returns:
the value of the 'Datatype' container reference.
See Also:
Operation.setDatatype(DataType), UMLPackage.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:
Operation.getDatatype()

getBodyCondition

public Constraint getBodyCondition()
Returns the value of the 'Body Condition' reference. An optional Constraint on the result values of an invocation of this Operation.

Returns:
the value of the 'Body Condition' reference.
See Also:
Operation.setBodyCondition(Constraint), UMLPackage.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:
Operation.getBodyCondition()

createBodyCondition

public Constraint createBodyCondition(String name,
                                      EClass eClass)
Creates a new Constraint, with the specified 'Name', and sets the 'Body Condition' reference.

Parameters:
name - The 'Name' for the new Constraint, or null.
eClass - The Ecore class of the Constraint to create.
Returns:
The new Constraint.
See Also:
Operation.getBodyCondition()

createBodyCondition

public Constraint createBodyCondition(String name)
Creates a new Constraint,with the specified 'Name', and sets the 'Body Condition' reference.

Parameters:
name - The 'Name' for the new Constraint, or null.
Returns:
The new Constraint.
See Also:
Operation.getBodyCondition()

getType

public Type getType()
Returns the value of the 'Type' reference. This information is derived from the return result for this Operation. Specifies the return result of the operation, if present.

Returns:
the value of the 'Type' reference.
See Also:
Operation.setType(Type), UMLPackage.getOperation_Type()

setType

public void setType(Type value)
Sets the value of the 'Type' reference.

Parameters:
value - the new value of the 'Type' reference.
See Also:
Operation.getType()

getInterface

public Interface getInterface()
Returns the value of the 'Interface' container reference. It is bidirectional and its opposite is 'Owned Operation'. The Interface that owns this Operation.

Returns:
the value of the 'Interface' container reference.
See Also:
Operation.setInterface(Interface), UMLPackage.getOperation_Interface(), Interface.getOwnedOperations()

setInterface

public void setInterface(Interface value)
Sets the value of the 'Interface' container reference.

Parameters:
value - the new value of the 'Interface' container reference.
See Also:
Operation.getInterface()

validateAtMostOneReturn

public boolean validateAtMostOneReturn(DiagnosticChain diagnostics,
                                       Map context)
An operation can have at most one return parameter; i.e., an owned parameter with the direction set to 'return' self.ownedParameter->select(par | par.direction = #return)->size() <= 1


validateOnlyBodyForQuery

public boolean validateOnlyBodyForQuery(DiagnosticChain diagnostics,
                                        Map context)
A bodyCondition can only be specified for a query operation. bodyCondition->notEmpty() implies isQuery


getReturnResult

public Parameter getReturnResult()
Retrieves the (only) return result parameter for this operation.


lowerBound

public int lowerBound()
If this operation has a return parameter, lower equals the value of lower for that parameter. Otherwise lower is not defined. result = if returnResult()->notEmpty() then returnResult()->any().lower else Set{} endif


upperBound

public int upperBound()
If this operation has a return parameter, upper equals the value of upper for that parameter. Otherwise upper is not defined. result = if returnResult()->notEmpty() then returnResult()->any().upper else Set{} endif


returnResult

public EList returnResult()
The query returnResult() returns the set containing the return parameter of the Operation if one exists, otherwise, it returns an empty set result = ownedParameter->select (par | par.direction = #return)


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