org.eclipse.uml2.uml
Interface Behavior

All Superinterfaces:
BehavioredClassifier, Class, Classifier, Element, EModelElement, EncapsulatedClassifier, EObject, NamedElement, Namespace, Notifier, PackageableElement, ParameterableElement, RedefinableElement, StructuredClassifier, TemplateableElement, Type
All Known Subinterfaces:
Activity, FunctionBehavior, Interaction, OpaqueBehavior, ProtocolStateMachine, StateMachine

public interface Behavior
extends Class

A representation of the model object 'Behavior'. Behavior is a specification of how its context classifier changes state over time. This specification may be either a definition of possible behavior execution or emergent behavior, or a selective illustration of an interesting subset of possible executions. The latter form is typically used for capturing examples, such as a trace of a particular execution. A behavior owns zero or more parameter sets.

The following features are supported:

See Also:
UMLPackage.getBehavior()

Field Summary
 
Fields inherited from interface org.eclipse.uml2.uml.NamedElement
SEPARATOR
 
Method Summary
 Parameter createOwnedParameter(String name, Type type)
          Creates a new Parameter, with the specified 'Name', and 'Type', and appends it to the 'Owned Parameter' containment reference list
 ParameterSet createOwnedParameterSet(String name)
          Creates a new ParameterSet, with the specified 'Name', and appends it to the 'Owned Parameter Set' containment reference list
 Constraint createPostcondition(String name)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Postcondition' containment reference list
 Constraint createPostcondition(String name, EClass eClass)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Postcondition' containment reference list
 Constraint createPrecondition(String name)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Precondition' containment reference list
 Constraint createPrecondition(String name, EClass eClass)
          Creates a new Constraint, with the specified 'Name', and appends it to the 'Precondition' containment reference list
 BehavioredClassifier getContext()
          Returns the value of the 'Context' reference
 Parameter getOwnedParameter(String name, Type type)
          Retrieves the first Parameter with the specified 'Name', and 'Type' from the 'Owned Parameter' containment reference list
 Parameter getOwnedParameter(String name, Type type, boolean ignoreCase, boolean createOnDemand)
          Retrieves the first Parameter with the specified 'Name', and 'Type' from the 'Owned Parameter' containment reference list
 EList getOwnedParameters()
          Returns the value of the 'Owned Parameter' containment reference list.
 ParameterSet getOwnedParameterSet(String name)
          Retrieves the first ParameterSet with the specified 'Name' from the 'Owned Parameter Set' containment reference list
 ParameterSet getOwnedParameterSet(String name, boolean ignoreCase, boolean createOnDemand)
          Retrieves the first ParameterSet with the specified 'Name' from the 'Owned Parameter Set' containment reference list
 EList getOwnedParameterSets()
          Returns the value of the 'Owned Parameter Set' containment reference list.
 Constraint getPostcondition(String name)
          Retrieves the first Constraint with the specified 'Name' from the 'Postcondition' containment reference list
 Constraint getPostcondition(String name, boolean ignoreCase, EClass eClass, boolean createOnDemand)
          Retrieves the first Constraint with the specified 'Name' from the 'Postcondition' containment reference list
 EList getPostconditions()
          Returns the value of the 'Postcondition' containment reference list.
 Constraint getPrecondition(String name)
          Retrieves the first Constraint with the specified 'Name' from the 'Precondition' containment reference list
 Constraint getPrecondition(String name, boolean ignoreCase, EClass eClass, boolean createOnDemand)
          Retrieves the first Constraint with the specified 'Name' from the 'Precondition' containment reference list
 EList getPreconditions()
          Returns the value of the 'Precondition' containment reference list.
 Behavior getRedefinedBehavior(String name)
          Retrieves the first Behavior with the specified 'Name' from the 'Redefined Behavior' reference list
 Behavior getRedefinedBehavior(String name, boolean ignoreCase, EClass eClass)
          Retrieves the first Behavior with the specified 'Name' from the 'Redefined Behavior' reference list
 EList getRedefinedBehaviors()
          Returns the value of the 'Redefined Behavior' reference list.
 BehavioralFeature getSpecification()
          Returns the value of the 'Specification' reference.
 boolean isReentrant()
          Returns the value of the 'Is Reentrant' attribute.
 void setIsReentrant(boolean value)
          Sets the value of the 'Is Reentrant' attribute
 void setSpecification(BehavioralFeature value)
          Sets the value of the 'Specification' reference
 boolean validateFeatureOfContextClassifier(DiagnosticChain diagnostics, Map context)
           The implemented behavioral feature must be a feature (possibly inherited) of the context classifier of the behavior.
 boolean validateMostOneBehaviour(DiagnosticChain diagnostics, Map context)
           There may be at most one behavior for a given pairing of classifier (as owner of the behavior) and behavioral feature (as specification of the behavior).
 boolean validateMustRealize(DiagnosticChain diagnostics, Map context)
           If the implemented behavioral feature has been redefined in the ancestors of the owner of the behavior, then the behavior must realize the latest redefining behavioral feature.
 boolean validateParametersMatch(DiagnosticChain diagnostics, Map context)
           The parameters of the behavior must match the parameters of the implemented behavioral feature.
 
Methods inherited from interface org.eclipse.uml2.uml.Class
createNestedClassifier, createOwnedOperation, createOwnedOperation, createOwnedReception, getExtension, getExtension, getExtensions, getNestedClassifier, getNestedClassifier, getNestedClassifiers, getOwnedOperation, getOwnedOperation, getOwnedOperations, getOwnedReception, getOwnedReception, getOwnedReceptions, getSuperClass, getSuperClass, getSuperClasses, isActive, isMetaclass, setIsActive, validatePassiveClass
 
Methods inherited from interface org.eclipse.uml2.uml.EncapsulatedClassifier
createOwnedPort, getOwnedPort, getOwnedPort, getOwnedPorts
 
Methods inherited from interface org.eclipse.uml2.uml.StructuredClassifier
createOwnedAttribute, createOwnedAttribute, createOwnedAttribute, createOwnedConnector, getOwnedAttribute, getOwnedAttribute, getOwnedAttributes, getOwnedConnector, getOwnedConnector, getOwnedConnectors, getPart, getPart, getParts, getRole, getRole, getRoles, validateMultiplicities
 
Methods inherited from interface org.eclipse.uml2.uml.Classifier
allFeatures, allParents, conformsTo, createCollaborationUse, createGeneralization, createOwnedUseCase, createRepresentation, createSubstitution, getAllAttributes, getAllOperations, getAllUsedInterfaces, getAttribute, getAttribute, getAttributes, getCollaborationUse, getCollaborationUse, getCollaborationUses, getFeature, getFeature, getFeatures, getGeneral, getGeneral, getGeneralization, getGeneralization, getGeneralizations, getGenerals, getInheritedMember, getInheritedMember, getInheritedMembers, getOperation, getOperation, getOperations, getOwnedUseCase, getOwnedUseCase, getOwnedUseCases, getPowertypeExtent, getPowertypeExtent, getPowertypeExtents, getRedefinedClassifier, getRedefinedClassifier, getRedefinedClassifiers, getRepresentation, getSubstitution, getSubstitution, getSubstitutions, getUseCase, getUseCase, getUseCases, getUsedInterfaces, hasVisibilityOf, inherit, inheritableMembers, isAbstract, maySpecializeType, parents, setIsAbstract, setRepresentation, validateGeneralizationHierarchies, validateMapsToGeneralizationSet, validateNoCyclesInGeneralization, validateSpecializeType
 
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.RedefinableElement
getRedefinedElement, getRedefinedElement, getRedefinedElements, getRedefinitionContext, getRedefinitionContext, getRedefinitionContexts, isConsistentWith, isLeaf, isRedefinitionContextValid, setIsLeaf, validateRedefinitionConsistent, validateRedefinitionContextValid
 
Methods inherited from interface org.eclipse.uml2.uml.Type
conformsTo, createAssociation, getAssociations, getPackage, setPackage
 
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
 
Methods inherited from interface org.eclipse.uml2.uml.BehavioredClassifier
createClassifierBehavior, createInterfaceRealization, createOwnedBehavior, createOwnedTrigger, getAllImplementedInterfaces, getClassifierBehavior, getImplementedInterfaces, getInterfaceRealization, getInterfaceRealization, getInterfaceRealizations, getOwnedBehavior, getOwnedBehavior, getOwnedBehaviors, getOwnedTrigger, getOwnedTrigger, getOwnedTriggers, setClassifierBehavior, validateClassBehavior
 

Method Detail

isReentrant

public boolean isReentrant()
Returns the value of the 'Is Reentrant' attribute. The default value is "false". Tells whether the behavior can be invoked while it is still executing from a previous invocation.

Returns:
the value of the 'Is Reentrant' attribute.
See Also:
Behavior.setIsReentrant(boolean), UMLPackage.getBehavior_IsReentrant()

setIsReentrant

public void setIsReentrant(boolean value)
Sets the value of the 'Is Reentrant' attribute.

Parameters:
value - the new value of the 'Is Reentrant' attribute.
See Also:
Behavior.isReentrant()

getRedefinedBehaviors

public EList getRedefinedBehaviors()
Returns the value of the 'Redefined Behavior' reference list. The list contents are of type Behavior. References a behavior that this behavior redefines. A subtype of Behavior may redefine any other subtype of Behavior. If the behavior implements a behavioral feature, it replaces the redefined behavior. If the behavior is a classifier behavior, it extends the redefined behavior.

Returns:
the value of the 'Redefined Behavior' reference list.
See Also:
UMLPackage.getBehavior_RedefinedBehavior()

getRedefinedBehavior

public Behavior getRedefinedBehavior(String name)
Retrieves the first Behavior with the specified 'Name' from the 'Redefined Behavior' reference list.

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

getRedefinedBehavior

public Behavior getRedefinedBehavior(String name,
                                     boolean ignoreCase,
                                     EClass eClass)
Retrieves the first Behavior with the specified 'Name' from the 'Redefined Behavior' reference list.

Parameters:
name - The 'Name' of the Behavior to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
eClass - The Ecore class of the Behavior to retrieve, or null.
Returns:
The first Behavior with the specified 'Name', or null.
See Also:
Behavior.getRedefinedBehaviors()

getOwnedParameters

public EList getOwnedParameters()
Returns the value of the 'Owned Parameter' containment reference list. The list contents are of type Parameter. References a list of parameters to the behavior which describes the order and type of arguments that can be given when the behavior is invoked and of the values which will be returned when the behavior completes its execution.

Returns:
the value of the 'Owned Parameter' containment reference list.
See Also:
UMLPackage.getBehavior_OwnedParameter()

createOwnedParameter

public Parameter createOwnedParameter(String name,
                                      Type type)
Creates a new Parameter, with the specified 'Name', and 'Type', and appends it to the 'Owned Parameter' containment reference list.

Parameters:
name - The 'Name' for the new Parameter, or null.
type - The 'Type' for the new Parameter, or null.
Returns:
The new Parameter.
See Also:
Behavior.getOwnedParameters()

getOwnedParameter

public Parameter getOwnedParameter(String name,
                                   Type type)
Retrieves the first Parameter with the specified 'Name', and 'Type' from the 'Owned Parameter' containment reference list.

Parameters:
name - The 'Name' of the Parameter to retrieve, or null.
type - The 'Type' of the Parameter to retrieve, or null.
Returns:
The first Parameter with the specified 'Name', and 'Type', or null.
See Also:
Behavior.getOwnedParameters()

getOwnedParameter

public Parameter getOwnedParameter(String name,
                                   Type type,
                                   boolean ignoreCase,
                                   boolean createOnDemand)
Retrieves the first Parameter with the specified 'Name', and 'Type' from the 'Owned Parameter' containment reference list.

Parameters:
name - The 'Name' of the Parameter to retrieve, or null.
type - The 'Type' of the Parameter to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
createOnDemand - Whether to create a Parameter on demand if not found.
Returns:
The first Parameter with the specified 'Name', and 'Type', or null.
See Also:
Behavior.getOwnedParameters()

getContext

public BehavioredClassifier getContext()
Returns the value of the 'Context' reference. The classifier that is the context for the execution of the behavior. If the behavior is owned by a BehavioredClassifier, that classifier is the context. Otherwise, the context is the first BehavioredClassifier reached by following the chain of owner relationships. For example, following this algorithm, the context of an entry action in a state machine is the classifier that owns the state machine. The features of the context classifier as well as the elements visible to the context classifier are visible to the behavior.

Returns:
the value of the 'Context' reference.
See Also:
UMLPackage.getBehavior_Context()

getPreconditions

public EList getPreconditions()
Returns the value of the 'Precondition' containment reference list. The list contents are of type Constraint. An optional set of Constraints specifying what must be fulfilled when the behavior is invoked.

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

createPrecondition

public Constraint createPrecondition(String name,
                                     EClass eClass)
Creates a new Constraint, with the specified 'Name', and appends it to the 'Precondition' containment 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:
Behavior.getPreconditions()

createPrecondition

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

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

getPrecondition

public Constraint getPrecondition(String name)
Retrieves the first Constraint with the specified 'Name' from the 'Precondition' containment 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:
Behavior.getPreconditions()

getPrecondition

public Constraint getPrecondition(String name,
                                  boolean ignoreCase,
                                  EClass eClass,
                                  boolean createOnDemand)
Retrieves the first Constraint with the specified 'Name' from the 'Precondition' containment 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:
Behavior.getPreconditions()

getPostconditions

public EList getPostconditions()
Returns the value of the 'Postcondition' containment reference list. The list contents are of type Constraint. An optional set of Constraints specifying what is fulfilled after the execution of the behavior is completed, if its precondition was fulfilled before its invocation.

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

createPostcondition

public Constraint createPostcondition(String name,
                                      EClass eClass)
Creates a new Constraint, with the specified 'Name', and appends it to the 'Postcondition' containment 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:
Behavior.getPostconditions()

createPostcondition

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

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

getPostcondition

public Constraint getPostcondition(String name)
Retrieves the first Constraint with the specified 'Name' from the 'Postcondition' containment 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:
Behavior.getPostconditions()

getPostcondition

public Constraint getPostcondition(String name,
                                   boolean ignoreCase,
                                   EClass eClass,
                                   boolean createOnDemand)
Retrieves the first Constraint with the specified 'Name' from the 'Postcondition' containment 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:
Behavior.getPostconditions()

getOwnedParameterSets

public EList getOwnedParameterSets()
Returns the value of the 'Owned Parameter Set' containment reference list. The list contents are of type ParameterSet. The ParameterSets owned by this Behavior.

Returns:
the value of the 'Owned Parameter Set' containment reference list.
See Also:
UMLPackage.getBehavior_OwnedParameterSet()

createOwnedParameterSet

public ParameterSet createOwnedParameterSet(String name)
Creates a new ParameterSet, with the specified 'Name', and appends it to the 'Owned Parameter Set' containment reference list.

Parameters:
name - The 'Name' for the new ParameterSet, or null.
Returns:
The new ParameterSet.
See Also:
Behavior.getOwnedParameterSets()

getOwnedParameterSet

public ParameterSet getOwnedParameterSet(String name)
Retrieves the first ParameterSet with the specified 'Name' from the 'Owned Parameter Set' containment reference list.

Parameters:
name - The 'Name' of the ParameterSet to retrieve, or null.
Returns:
The first ParameterSet with the specified 'Name', or null.
See Also:
Behavior.getOwnedParameterSets()

getOwnedParameterSet

public ParameterSet getOwnedParameterSet(String name,
                                         boolean ignoreCase,
                                         boolean createOnDemand)
Retrieves the first ParameterSet with the specified 'Name' from the 'Owned Parameter Set' containment reference list.

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

getSpecification

public BehavioralFeature getSpecification()
Returns the value of the 'Specification' reference. It is bidirectional and its opposite is 'Method'. Designates a behavioral feature that the behavior implements. The behavioral feature must be owned by the classifier that owns the behavior or be inherited by it. The parameters of the behavioral feature and the implementing behavior must match. If a behavior does not have a specification, it is directly associated with a classifier (i.e., it is the behavior of the classifier as a whole).

Returns:
the value of the 'Specification' reference.
See Also:
Behavior.setSpecification(BehavioralFeature), UMLPackage.getBehavior_Specification(), BehavioralFeature.getMethods()

setSpecification

public void setSpecification(BehavioralFeature value)
Sets the value of the 'Specification' reference.

Parameters:
value - the new value of the 'Specification' reference.
See Also:
Behavior.getSpecification()

validateParametersMatch

public boolean validateParametersMatch(DiagnosticChain diagnostics,
                                       Map context)
The parameters of the behavior must match the parameters of the implemented behavioral feature. true


validateFeatureOfContextClassifier

public boolean validateFeatureOfContextClassifier(DiagnosticChain diagnostics,
                                                  Map context)
The implemented behavioral feature must be a feature (possibly inherited) of the context classifier of the behavior. true


validateMustRealize

public boolean validateMustRealize(DiagnosticChain diagnostics,
                                   Map context)
If the implemented behavioral feature has been redefined in the ancestors of the owner of the behavior, then the behavior must realize the latest redefining behavioral feature. true


validateMostOneBehaviour

public boolean validateMostOneBehaviour(DiagnosticChain diagnostics,
                                        Map context)
There may be at most one behavior for a given pairing of classifier (as owner of the behavior) and behavioral feature (as specification of the behavior). true


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