blob: d434a99943517a3e5cdca9a8a9d35b0b236a2653 [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: Interface.java,v 1.11 2006/12/14 15:49:27 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>Interface</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* An interface is a kind of classifier that represents a declaration of a set of coherent public features and obligations. An interface specifies a contract; any instance of a classifier that realizes the interface must fulfill that contract. The obligations that may be associated with an interface are in the form of various kinds of constraints (such as pre- and post-conditions) or protocol specifications, which may impose ordering restrictions on interactions through the interface.
* Interfaces may include receptions (in addition to operations).
* Since an interface specifies conformance characteristics, it does not own detailed behavior specifications. Instead, interfaces may own a protocol state machine that specifies event sequences and pre/post conditions for the operations and receptions described by the interface.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.uml2.uml.Interface#getOwnedAttributes <em>Owned Attribute</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Interface#getOwnedOperations <em>Owned Operation</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Interface#getNestedClassifiers <em>Nested Classifier</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Interface#getRedefinedInterfaces <em>Redefined Interface</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Interface#getOwnedReceptions <em>Owned Reception</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Interface#getProtocol <em>Protocol</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.uml2.uml.UMLPackage#getInterface()
* @model
* @generated
*/
public interface Interface
extends Classifier {
/**
* Returns the value of the '<em><b>Owned Attribute</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Property}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The attributes (i.e. the properties) owned by the class.
* <!-- end-model-doc -->
* @return the value of the '<em>Owned Attribute</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getInterface_OwnedAttribute()
* @model type="org.eclipse.uml2.uml.Property" containment="true" resolveProxies="true"
* @generated
*/
EList<Property> getOwnedAttributes();
/**
* Creates a new {@link org.eclipse.uml2.uml.Property}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and appends it to the '<em><b>Owned Attribute</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.Property}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Property} to create.
* @return The new {@link org.eclipse.uml2.uml.Property}.
* @see #getOwnedAttributes()
* @generated
*/
Property createOwnedAttribute(String name, Type type, EClass eClass);
/**
* Creates a new {@link org.eclipse.uml2.uml.Property}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and appends it to the '<em><b>Owned Attribute</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.Property}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Property}.
* @see #getOwnedAttributes()
* @generated
*/
Property createOwnedAttribute(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Owned Attribute</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.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getOwnedAttributes()
* @generated
*/
Property getOwnedAttribute(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Owned Attribute</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.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} 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.Property} to retrieve, or <code>null</code>.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Property} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getOwnedAttributes()
* @generated
*/
Property getOwnedAttribute(String name, Type type, boolean ignoreCase,
EClass eClass, boolean createOnDemand);
/**
* Returns the value of the '<em><b>Nested Classifier</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Classifier}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* References all the Classifiers that are defined (nested) within the Class.
* <!-- end-model-doc -->
* @return the value of the '<em>Nested Classifier</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getInterface_NestedClassifier()
* @model type="org.eclipse.uml2.uml.Classifier" containment="true" resolveProxies="true"
* @generated
*/
EList<Classifier> getNestedClassifiers();
/**
* Creates a new {@link org.eclipse.uml2.uml.Classifier}, with the specified '<em><b>Name</b></em>', and appends it to the '<em><b>Nested Classifier</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.Classifier}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to create.
* @return The new {@link org.eclipse.uml2.uml.Classifier}.
* @see #getNestedClassifiers()
* @generated
*/
Classifier createNestedClassifier(String name, EClass eClass);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>' from the '<em><b>Nested Classifier</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.Classifier} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getNestedClassifiers()
* @generated
*/
Classifier getNestedClassifier(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>' from the '<em><b>Nested Classifier</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.Classifier} 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.Classifier} to retrieve, or <code>null</code>.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Classifier} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getNestedClassifiers()
* @generated
*/
Classifier getNestedClassifier(String name, boolean ignoreCase,
EClass eClass, boolean createOnDemand);
/**
* Returns the value of the '<em><b>Redefined Interface</b></em>' reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Interface}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* References all the Interfaces redefined by this Interface.
* <!-- end-model-doc -->
* @return the value of the '<em>Redefined Interface</em>' reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getInterface_RedefinedInterface()
* @model type="org.eclipse.uml2.uml.Interface" ordered="false"
* @generated
*/
EList<Interface> getRedefinedInterfaces();
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Interface} with the specified '<em><b>Name</b></em>' from the '<em><b>Redefined Interface</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.Interface} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Interface} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getRedefinedInterfaces()
* @generated
*/
Interface getRedefinedInterface(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Interface} with the specified '<em><b>Name</b></em>' from the '<em><b>Redefined Interface</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.Interface} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @return The first {@link org.eclipse.uml2.uml.Interface} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getRedefinedInterfaces()
* @generated
*/
Interface getRedefinedInterface(String name, boolean ignoreCase);
/**
* Returns the value of the '<em><b>Owned Reception</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Reception}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Receptions that objects providing this interface are willing to accept.
* <!-- end-model-doc -->
* @return the value of the '<em>Owned Reception</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getInterface_OwnedReception()
* @model type="org.eclipse.uml2.uml.Reception" containment="true" resolveProxies="true" ordered="false"
* @generated
*/
EList<Reception> getOwnedReceptions();
/**
* Creates a new {@link org.eclipse.uml2.uml.Reception}, with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>', and appends it to the '<em><b>Owned Reception</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.Reception}, or <code>null</code>.
* @param ownedParameterNames The '<em><b>Owned Parameter Names</b></em>' for the new {@link org.eclipse.uml2.uml.Reception}, or <code>null</code>.
* @param ownedParameterTypes The '<em><b>Owned Parameter Types</b></em>' for the new {@link org.eclipse.uml2.uml.Reception}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Reception}.
* @see #getOwnedReceptions()
* @generated
*/
Reception createOwnedReception(String name,
EList<String> ownedParameterNames, EList<Type> ownedParameterTypes);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Reception} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>' from the '<em><b>Owned Reception</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.Reception} to retrieve, or <code>null</code>.
* @param ownedParameterNames The '<em><b>Owned Parameter Names</b></em>' of the {@link org.eclipse.uml2.uml.Reception} to retrieve, or <code>null</code>.
* @param ownedParameterTypes The '<em><b>Owned Parameter Types</b></em>' of the {@link org.eclipse.uml2.uml.Reception} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Reception} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>', or <code>null</code>.
* @see #getOwnedReceptions()
* @generated
*/
Reception getOwnedReception(String name, EList<String> ownedParameterNames,
EList<Type> ownedParameterTypes);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Reception} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>' from the '<em><b>Owned Reception</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.Reception} to retrieve, or <code>null</code>.
* @param ownedParameterNames The '<em><b>Owned Parameter Names</b></em>' of the {@link org.eclipse.uml2.uml.Reception} to retrieve, or <code>null</code>.
* @param ownedParameterTypes The '<em><b>Owned Parameter Types</b></em>' of the {@link org.eclipse.uml2.uml.Reception} 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.Reception} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Reception} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>', or <code>null</code>.
* @see #getOwnedReceptions()
* @generated
*/
Reception getOwnedReception(String name, EList<String> ownedParameterNames,
EList<Type> ownedParameterTypes, boolean ignoreCase,
boolean createOnDemand);
/**
* Returns the value of the '<em><b>Protocol</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* References a protocol state machine specifying the legal sequences of the invocation of the behavioral features described in the interface.
* <!-- end-model-doc -->
* @return the value of the '<em>Protocol</em>' containment reference.
* @see #setProtocol(ProtocolStateMachine)
* @see org.eclipse.uml2.uml.UMLPackage#getInterface_Protocol()
* @model containment="true" resolveProxies="true" ordered="false"
* @generated
*/
ProtocolStateMachine getProtocol();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Interface#getProtocol <em>Protocol</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Protocol</em>' containment reference.
* @see #getProtocol()
* @generated
*/
void setProtocol(ProtocolStateMachine value);
/**
* Creates a new {@link org.eclipse.uml2.uml.ProtocolStateMachine},with the specified '<em><b>Name</b></em>', and sets the '<em><b>Protocol</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.ProtocolStateMachine}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.ProtocolStateMachine}.
* @see #getProtocol()
* @generated
*/
ProtocolStateMachine createProtocol(String name);
/**
* Returns the value of the '<em><b>Owned Operation</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Operation}.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.Operation#getInterface <em>Interface</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The operations owned by the class.
* <!-- end-model-doc -->
* @return the value of the '<em>Owned Operation</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getInterface_OwnedOperation()
* @see org.eclipse.uml2.uml.Operation#getInterface
* @model type="org.eclipse.uml2.uml.Operation" opposite="interface" containment="true" resolveProxies="true"
* @generated
*/
EList<Operation> getOwnedOperations();
/**
* Creates a new {@link org.eclipse.uml2.uml.Operation}, with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>', and appends it to the '<em><b>Owned Operation</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.Operation}, or <code>null</code>.
* @param ownedParameterNames The '<em><b>Owned Parameter Names</b></em>' for the new {@link org.eclipse.uml2.uml.Operation}, or <code>null</code>.
* @param ownedParameterTypes The '<em><b>Owned Parameter Types</b></em>' for the new {@link org.eclipse.uml2.uml.Operation}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Operation}.
* @see #getOwnedOperations()
* @generated
*/
Operation createOwnedOperation(String name,
EList<String> ownedParameterNames, EList<Type> ownedParameterTypes);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Operation} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>' from the '<em><b>Owned Operation</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.Operation} to retrieve, or <code>null</code>.
* @param ownedParameterNames The '<em><b>Owned Parameter Names</b></em>' of the {@link org.eclipse.uml2.uml.Operation} to retrieve, or <code>null</code>.
* @param ownedParameterTypes The '<em><b>Owned Parameter Types</b></em>' of the {@link org.eclipse.uml2.uml.Operation} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Operation} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>', or <code>null</code>.
* @see #getOwnedOperations()
* @generated
*/
Operation getOwnedOperation(String name, EList<String> ownedParameterNames,
EList<Type> ownedParameterTypes);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Operation} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>' from the '<em><b>Owned Operation</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.Operation} to retrieve, or <code>null</code>.
* @param ownedParameterNames The '<em><b>Owned Parameter Names</b></em>' of the {@link org.eclipse.uml2.uml.Operation} to retrieve, or <code>null</code>.
* @param ownedParameterTypes The '<em><b>Owned Parameter Types</b></em>' of the {@link org.eclipse.uml2.uml.Operation} 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.Operation} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Operation} with the specified '<em><b>Name</b></em>', '<em><b>Owned Parameter Names</b></em>', and '<em><b>Owned Parameter Types</b></em>', or <code>null</code>.
* @see #getOwnedOperations()
* @generated
*/
Operation getOwnedOperation(String name, EList<String> ownedParameterNames,
EList<Type> ownedParameterTypes, boolean ignoreCase,
boolean createOnDemand);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The visibility of all features owned by an interface must be public.
* self.feature->forAll(f | f.visibility = #public)
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateVisibility(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Creates an operation with the specified name, parameter names, parameter types, and return type (or null) as an owned operation of this interface.
* <!-- end-model-doc -->
* @model required="true" ordered="false" nameDataType="org.eclipse.uml2.uml.String" nameOrdered="false" parameterNamesType="java.lang.String" parameterNamesDataType="org.eclipse.uml2.uml.String" parameterNamesMany="true" parameterNamesOrdered="false" parameterTypesType="org.eclipse.uml2.uml.Type" parameterTypesMany="true" parameterTypesOrdered="false" returnTypeOrdered="false"
* @generated
*/
Operation createOwnedOperation(String name, EList<String> parameterNames,
EList<Type> parameterTypes, Type returnType);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Creates a property with the specified name, type, lower bound, and upper bound as an owned attribute of this interface.
* <!-- end-model-doc -->
* @model required="true" ordered="false" nameDataType="org.eclipse.uml2.uml.String" nameOrdered="false" typeOrdered="false" lowerDataType="org.eclipse.uml2.uml.Integer" lowerRequired="true" lowerOrdered="false" upperDataType="org.eclipse.uml2.uml.UnlimitedNatural" upperRequired="true" upperOrdered="false"
* @generated
*/
Property createOwnedAttribute(String name, Type type, int lower, int upper);
} // Interface