blob: d9a3758f10b8fb155fd9746137f8df941e36707c [file] [log] [blame]
/*
* Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - initial API and implementation
*
* $Id: Behavior.java,v 1.14 2006/04/05 13:49:57 khussey Exp $
*/
package org.eclipse.uml2.uml;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Behavior</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* 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 classifier behavior is always a definition of behavior and not an illustration. It describes the sequence of state changes an instance of a classifier may undergo in the course of its lifetime. Its precise semantics depends on the kind of classifier. For example, the classifier behavior of a collaboration represents emergent behavior of all the parts, whereas the classifier behavior of a class is just the behavior of instances of the class separated from the behaviors of any of its parts.
* When a behavior is associated as the method of a behavioral feature, it defines the implementation of that feature; i.e., the computation that generates the effects of the behavioral feature.
*
* As a classifier, a behavior can be specialized. Instantiating a behavior is referred to as "invoking" the behavior, an instantiated behavior is also called a behavior "execution." A behavior may be invoked directly or its invocation may be the result of invoking the behavioral feature that specifies this behavior. A behavior can also be instantiated as an object in virtue of it being a class. The specification of a behavior can take a number of forms, as described in the subclasses of Behavior. Behavior is an abstract metaclass factoring out the commonalities of these different specification mechanisms.
*
* When a behavior is invoked, its execution receives a set of input values that are used to affect the course of execution and as a result of its execution it produces a set of output values which are returned, as specified by its parameters. The observable effects of a behavior execution may include changes of values of various objects involved in the execution, the creation and destruction of objects, generation of communications between objects, as well as an explicit set of output values.
*
* The concept of Behavior is extended to own ParameterSets.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.uml2.uml.Behavior#isReentrant <em>Is Reentrant</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Behavior#getRedefinedBehaviors <em>Redefined Behavior</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Behavior#getOwnedParameters <em>Owned Parameter</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Behavior#getContext <em>Context</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Behavior#getPreconditions <em>Precondition</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Behavior#getPostconditions <em>Postcondition</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Behavior#getOwnedParameterSets <em>Owned Parameter Set</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Behavior#getSpecification <em>Specification</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior()
* @model abstract="true"
* @generated
*/
public interface Behavior
extends org.eclipse.uml2.uml.Class {
/**
* Returns the value of the '<em><b>Is Reentrant</b></em>' attribute.
* The default value is <code>"false"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Tells whether the behavior can be invoked while it is still executing from a previous invocation.
* <!-- end-model-doc -->
* @return the value of the '<em>Is Reentrant</em>' attribute.
* @see #setIsReentrant(boolean)
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_IsReentrant()
* @model default="false" dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false"
* @generated
*/
boolean isReentrant();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Behavior#isReentrant <em>Is Reentrant</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Is Reentrant</em>' attribute.
* @see #isReentrant()
* @generated
*/
void setIsReentrant(boolean value);
/**
* Returns the value of the '<em><b>Redefined Behavior</b></em>' reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Behavior}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* 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.
* <!-- end-model-doc -->
* @return the value of the '<em>Redefined Behavior</em>' reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_RedefinedBehavior()
* @model type="org.eclipse.uml2.uml.Behavior" ordered="false"
* @generated
*/
EList getRedefinedBehaviors();
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Behavior} with the specified '<em><b>Name</b></em>' from the '<em><b>Redefined Behavior</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Behavior} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Behavior} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getRedefinedBehaviors()
* @generated
*/
Behavior getRedefinedBehavior(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Behavior} with the specified '<em><b>Name</b></em>' from the '<em><b>Redefined Behavior</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Behavior} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Behavior} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Behavior} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getRedefinedBehaviors()
* @generated
*/
Behavior getRedefinedBehavior(String name, boolean ignoreCase, EClass eClass);
/**
* Returns the value of the '<em><b>Owned Parameter</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Parameter}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* 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.
*
* <!-- end-model-doc -->
* @return the value of the '<em>Owned Parameter</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_OwnedParameter()
* @model type="org.eclipse.uml2.uml.Parameter" containment="true"
* @generated
*/
EList getOwnedParameters();
/**
* Creates a new {@link org.eclipse.uml2.uml.Parameter}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and appends it to the '<em><b>Owned Parameter</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Parameter}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.Parameter}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Parameter}.
* @see #getOwnedParameters()
* @generated
*/
Parameter createOwnedParameter(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Parameter} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Owned Parameter</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Parameter} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Parameter} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Parameter} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getOwnedParameters()
* @generated
*/
Parameter getOwnedParameter(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Parameter} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Owned Parameter</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Parameter} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Parameter} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Parameter} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Parameter} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getOwnedParameters()
* @generated
*/
Parameter getOwnedParameter(String name, Type type, boolean ignoreCase,
boolean createOnDemand);
/**
* Returns the value of the '<em><b>Context</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* 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.
* <!-- end-model-doc -->
* @return the value of the '<em>Context</em>' reference.
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_Context()
* @model transient="true" changeable="false" volatile="true" derived="true" ordered="false"
* @generated
*/
BehavioredClassifier getContext();
/**
* Returns the value of the '<em><b>Precondition</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Constraint}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Precondition</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Precondition</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_Precondition()
* @model type="org.eclipse.uml2.uml.Constraint" containment="true" ordered="false"
* @generated
*/
EList getPreconditions();
/**
* Creates a new {@link org.eclipse.uml2.uml.Constraint}, with the specified '<em><b>Name</b></em>', and appends it to the '<em><b>Precondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Constraint}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Constraint} to create.
* @return The new {@link org.eclipse.uml2.uml.Constraint}.
* @see #getPreconditions()
* @generated
*/
Constraint createPrecondition(String name, EClass eClass);
/**
* Creates a new {@link org.eclipse.uml2.uml.Constraint}, with the specified '<em><b>Name</b></em>', and appends it to the '<em><b>Precondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Constraint}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Constraint}.
* @see #getPreconditions()
* @generated
*/
Constraint createPrecondition(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>' from the '<em><b>Precondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getPreconditions()
* @generated
*/
Constraint getPrecondition(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>' from the '<em><b>Precondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or <code>null</code>.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Constraint} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getPreconditions()
* @generated
*/
Constraint getPrecondition(String name, boolean ignoreCase, EClass eClass,
boolean createOnDemand);
/**
* Returns the value of the '<em><b>Postcondition</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Constraint}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Postcondition</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Postcondition</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_Postcondition()
* @model type="org.eclipse.uml2.uml.Constraint" containment="true" ordered="false"
* @generated
*/
EList getPostconditions();
/**
* Creates a new {@link org.eclipse.uml2.uml.Constraint}, with the specified '<em><b>Name</b></em>', and appends it to the '<em><b>Postcondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Constraint}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Constraint} to create.
* @return The new {@link org.eclipse.uml2.uml.Constraint}.
* @see #getPostconditions()
* @generated
*/
Constraint createPostcondition(String name, EClass eClass);
/**
* Creates a new {@link org.eclipse.uml2.uml.Constraint}, with the specified '<em><b>Name</b></em>', and appends it to the '<em><b>Postcondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Constraint}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Constraint}.
* @see #getPostconditions()
* @generated
*/
Constraint createPostcondition(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>' from the '<em><b>Postcondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getPostconditions()
* @generated
*/
Constraint getPostcondition(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>' from the '<em><b>Postcondition</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or <code>null</code>.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Constraint} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Constraint} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getPostconditions()
* @generated
*/
Constraint getPostcondition(String name, boolean ignoreCase, EClass eClass,
boolean createOnDemand);
/**
* Returns the value of the '<em><b>Owned Parameter Set</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.ParameterSet}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The ParameterSets owned by this Behavior.
* <!-- end-model-doc -->
* @return the value of the '<em>Owned Parameter Set</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_OwnedParameterSet()
* @model type="org.eclipse.uml2.uml.ParameterSet" containment="true" ordered="false"
* @generated
*/
EList getOwnedParameterSets();
/**
* Creates a new {@link org.eclipse.uml2.uml.ParameterSet}, with the specified '<em><b>Name</b></em>', and appends it to the '<em><b>Owned Parameter Set</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.ParameterSet}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.ParameterSet}.
* @see #getOwnedParameterSets()
* @generated
*/
ParameterSet createOwnedParameterSet(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.ParameterSet} with the specified '<em><b>Name</b></em>' from the '<em><b>Owned Parameter Set</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.ParameterSet} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.ParameterSet} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getOwnedParameterSets()
* @generated
*/
ParameterSet getOwnedParameterSet(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.ParameterSet} with the specified '<em><b>Name</b></em>' from the '<em><b>Owned Parameter Set</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.ParameterSet} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.ParameterSet} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.ParameterSet} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getOwnedParameterSets()
* @generated
*/
ParameterSet getOwnedParameterSet(String name, boolean ignoreCase,
boolean createOnDemand);
/**
* Returns the value of the '<em><b>Specification</b></em>' reference.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.BehavioralFeature#getMethods <em>Method</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* 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).
* <!-- end-model-doc -->
* @return the value of the '<em>Specification</em>' reference.
* @see #setSpecification(BehavioralFeature)
* @see org.eclipse.uml2.uml.UMLPackage#getBehavior_Specification()
* @see org.eclipse.uml2.uml.BehavioralFeature#getMethods
* @model opposite="method" ordered="false"
* @generated
*/
BehavioralFeature getSpecification();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Behavior#getSpecification <em>Specification</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Specification</em>' reference.
* @see #getSpecification()
* @generated
*/
void setSpecification(BehavioralFeature value);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The parameters of the behavior must match the parameters of the implemented behavioral feature.
* true
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateParametersMatch(DiagnosticChain diagnostics, Map context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The implemented behavioral feature must be a feature (possibly inherited) of the context classifier of the behavior.
* true
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateFeatureOfContextClassifier(DiagnosticChain diagnostics,
Map context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* 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
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateMustRealize(DiagnosticChain diagnostics, Map context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* 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
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateMostOneBehaviour(DiagnosticChain diagnostics, Map context);
} // Behavior