## org.eclipse.uml2.uml
Interface Namespace

All Superinterfaces:
  Element, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.EObject, NamedElement, org.eclipse.emf.common.notify.Notifier

All Known Subinterfaces:
  Activity, Actor, Artifact, Association, AssociationClass, Behavior, BehavioralFeature, BehavioredClassifier, Class, Classifier, Collaboration, CommunicationPath, Component, ConditionalNode, DataType, DeploymentSpecification, Device, EncapsulatedClassifier, Enumeration, ExecutionEnvironment, ExpansionRegion, Extension, FinalState, FunctionBehavior, InformationItem, Interaction, InteractionOperand, Interface, LoopNode, Model, Node, OpaqueBehavior, Operation, Package, PrimitiveType, Profile, ProtocolStateMachine, ProtocolTransition, Reception, Region, SequenceNode, Signal, State, StateMachine, Stereotype, StructuredActivityNode, StructuredClassifier, Transition, UseCase

    public interface Namespace

extends NamedElement

A representation of the model object 'Namespace'. A namespace is an element in a model that contains a set of named elements that can be identified by name.

The following features are supported:

- `Element Import`
- `Package Import`
- `Owned Rule`
- `Member`
- `Imported Member`
- `Owned Member`

See Also:
  `UMLPackage.getNamespace()`

Field Summary

Fields inherited from interface org.eclipse.uml2.uml.NamedElement
`SEPARATOR`

Method Summary
`ElementImport` `createElementImport(PackageableElement importedElement)` Creates a new `ElementImport`, with the specified 'Imported Element', and appends it to the 'Element Import' containment reference list
`ElementImport` `createElementImport(PackageableElement element, VisibilityKind visibility)` Creates an import of the specified element into this namespace with the specified visibility.
`Constraint` `createOwnedRule(java.lang.String name)` Creates a new `Constraint`, with the specified 'Name', and appends it to the 'Owned Rule' containment reference list
`Constraint` `createOwnedRule(java.lang.String name, org.eclipse.emf.ecore.EClass eClass)` Creates a new `Constraint`, with the specified 'Name', and appends it to the 'Owned Rule' containment reference list
`PackageImport` `createPackageImport(Package importedPackage)` Creates a new `PackageImport`, with the specified 'Imported Package', and appends it to the 'Package Import' containment reference list
`PackageImport` `createPackageImport(Package package_, VisibilityKind visibility)` Creates an import of the specified package into this namespace with the specified visibility.
`org.eclipse.emf.common.util.EList<PackageableElement>` `excludeCollisions(org.eclipse.emf.common.util.EList<PackageableElement> imps)` The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this namespace.
`ElementImport` `getElementImport(PackageableElement importedElement)` Retrieves the first `ElementImport` with the specified 'Imported Element' from the 'Element Import' containment reference list
`ElementImport` `getElementImport(PackageableElement importedElement, boolean createOnDemand)` Retrieves the first `ElementImport` with the specified 'Imported Element' from the 'Element Import' containment reference list
`org.eclipse.emf.common.util.EList<ElementImport>` `getElementImports()` Returns the value of the 'Element Import' containment reference list.
`org.eclipse.emf.common.util.EList<PackageableElement>` `getImportedElements()` Retrieves the elements imported by this namespace
`PackageableElement` `getImportedMember(java.lang.String name)` Retrieves the first `PackageableElement` with the specified 'Name' from the 'Imported Member' reference list
`PackageableElement` `getImportedMember(java.lang.String name, boolean ignoreCase, org.eclipse.emf.ecore.EClass eClass)` Retrieves the first `PackageableElement` with the specified 'Name' from the 'Imported Member' reference list
`org.eclipse.emf.common.util.EList<PackageableElement>` `getImportedMembers()` Returns the value of the 'Imported Member' reference list.
`org.eclipse.emf.common.util.EList<Package>` `getImportedPackages()` Retrieves the packages imported by this namespace
`NamedElement` `getMember(java.lang.String name)` Retrieves the first `NamedElement` with the specified 'Name' from the 'Member' reference list
`NamedElement` `getMember(java.lang.String name, boolean ignoreCase, org.eclipse.emf.ecore.EClass eClass)` Retrieves the first `NamedElement` with the specified 'Name' from the 'Member' reference list
`org.eclipse.emf.common.util.EList<NamedElement>` `getMembers()` Returns the value of the 'Member' reference list.
`org.eclipse.emf.common.util.EList<java.lang.String>` `getNamesOfMember(NamedElement element)` The query getNamesOfMember() takes importing into account.
`NamedElement` `getOwnedMember(java.lang.String name)` Retrieves the first `NamedElement` with the specified 'Name' from the 'Owned Member' reference list
`NamedElement` `getOwnedMember(java.lang.String name, boolean ignoreCase, org.eclipse.emf.ecore.EClass eClass)` Retrieves the first `NamedElement` with the specified 'Name' from the 'Owned Member' reference list
`org.eclipse.emf.common.util.EList<NamedElement>` `getOwnedMembers()` Returns the value of the 'Owned Member' reference list.
`Constraint` `getOwnedRule(java.lang.String name)` Retrieves the first `Constraint` with the specified 'Name' from the 'Owned Rule' containment reference list
`Constraint` `getOwnedRule(java.lang.String name, boolean ignoreCase, org.eclipse.emf.ecore.EClass eClass, boolean createOnDemand)` Retrieves the first `Constraint` with the specified 'Name' from the 'Owned Rule' containment reference list
`org.eclipse.emf.common.util.EList<Constraint>` `getOwnedRules()` Returns the value of the 'Owned Rule' containment reference list.
`PackageImport` `getPackageImport(Package importedPackage)` Retrieves the first `PackageImport` with the specified 'Imported Package' from the 'Package Import' containment reference list
`PackageImport` `getPackageImport(Package importedPackage, boolean createOnDemand)` Retrieves the first `PackageImport` with the specified 'Imported Package' from the 'Package Import' containment reference list
`org.eclipse.emf.common.util.EList<PackageImport>` `getPackageImports()` Returns the value of the 'Package Import' containment reference list.
`org.eclipse.emf.common.util.EList<PackageableElement>` `importMembers(org.eclipse.emf.common.util.EList<PackageableElement> imps)` The query importMembers() defines which of a set of PackageableElements are actually imported into the namespace.
`boolean` `membersAreDistinguishable()` The Boolean query membersAreDistinguishable() determines whether all of the namespace's members are distinguishable within it.
`boolean` `validateMembersDistinguishable(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)` All the members of a Namespace are distinguishable within it.

Methods inherited from interface org.eclipse.uml2.uml.NamedElement

`allNamespaces, allOwningPackages, createDependency, createNameExpression, createUsage, 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, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset`

Methods inherited from interface org.eclipse.emf.common.notify.Notifier
`eAdapters, eDeliver, eNotify, eSetDeliver`

Method Detail

### getElementImports

    org.eclipse.emf.common.util.EList<ElementImport> getElementImports()

  Returns the value of the 'Element Import' containment reference list. The list contents are of type `ElementImport`. It is bidirectional and its opposite is '`Importing Namespace`'.

  This feature subsets the following features:

  - '`Owned Element`'
  References the ElementImports owned by the Namespace.

  Returns:
    the value of the 'Element Import' containment reference list.
  See Also:
    `UMLPackage.getNamespace_ElementImport()`, `ElementImport.getImportingNamespace()`

### createElementImport

    ElementImport createElementImport(PackageableElement importedElement)

  Creates a new `ElementImport`, with the specified 'Imported Element', and appends it to the 'Element Import' containment reference list.

  Parameters:
    `importedElement` - The 'Imported Element' for the new `ElementImport`, or `null`.
  Returns:
    The new `ElementImport`.
  See Also:
    `getElementImports()`

### getElementImport

    ElementImport getElementImport(PackageableElement importedElement)

  Retrieves the first `ElementImport` with the specified 'Imported Element' from the 'Element Import' containment reference list.

  Parameters:
    `importedElement` - The 'Imported Element' of the `ElementImport` to retrieve, or `null`.
  Returns:
    The first `ElementImport` with the specified 'Imported Element', or `null`.
  See Also:
    `getElementImports()`

### getElementImport

    ElementImport getElementImport(PackageableElement importedElement,
                                   boolean createOnDemand)

  Retrieves the first `ElementImport` with the specified 'Imported Element' from the 'Element Import' containment reference list.

  Parameters:
    `importedElement` - The 'Imported Element' of the `ElementImport` to retrieve, or `null`.
    `createOnDemand` - Whether to create a `ElementImport` on demand if not found.
  Returns:
    The first `ElementImport` with the specified 'Imported Element', or `null`.
  See Also:
    `getElementImports()`

### getPackageImports

    org.eclipse.emf.common.util.EList<PackageImport> getPackageImports()

  Returns the value of the 'Package Import' containment reference list. The list contents are of type `PackageImport`. It is bidirectional and its opposite is '`Importing Namespace`'.

  This feature subsets the following features:

  - '`Owned Element`'
  References the PackageImports owned by the Namespace.

  Returns:
    the value of the 'Package Import' containment reference list.
  See Also:
    `UMLPackage.getNamespace_PackageImport()`, `PackageImport.getImportingNamespace()`

### createPackageImport

    PackageImport createPackageImport(Package importedPackage)

  Creates a new `PackageImport`, with the specified 'Imported Package', and appends it to the 'Package Import' containment reference list.

  Parameters:
    `importedPackage` - The 'Imported Package' for the new `PackageImport`, or `null`.
  Returns:
    The new `PackageImport`.
  See Also:
    `getPackageImports()`

### getPackageImport

    PackageImport getPackageImport(Package importedPackage)

  Retrieves the first `PackageImport` with the specified 'Imported Package' from the 'Package Import' containment reference list.

  Parameters:
    `importedPackage` - The 'Imported Package' of the `PackageImport` to retrieve, or `null`.
  Returns:
    The first `PackageImport` with the specified 'Imported Package', or `null`.
  See Also:
    `getPackageImports()`

### getPackageImport

    PackageImport getPackageImport(Package importedPackage,
                                   boolean createOnDemand)

  Retrieves the first `PackageImport` with the specified 'Imported Package' from the 'Package Import' containment reference list.

  Parameters:
    `importedPackage` - The 'Imported Package' of the `PackageImport` to retrieve, or `null`.
    `createOnDemand` - Whether to create a `PackageImport` on demand if not found.
  Returns:
    The first `PackageImport` with the specified 'Imported Package', or `null`.
  See Also:
    `getPackageImports()`

### getOwnedRules

    org.eclipse.emf.common.util.EList<Constraint> getOwnedRules()

  Returns the value of the 'Owned Rule' containment reference list. The list contents are of type `Constraint`. It is bidirectional and its opposite is '`Context`'.

  This feature subsets the following features:

  - '`Owned Member`'
  Specifies a set of Constraints owned by this Namespace.

  Returns:
    the value of the 'Owned Rule' containment reference list.
  See Also:
    `UMLPackage.getNamespace_OwnedRule()`, `Constraint.getContext()`

### createOwnedRule

    Constraint createOwnedRule(java.lang.String name,
                               org.eclipse.emf.ecore.EClass eClass)

  Creates a new `Constraint`, with the specified 'Name', and appends it to the 'Owned Rule' 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:
    `getOwnedRules()`

### createOwnedRule

    Constraint createOwnedRule(java.lang.String name)

  Creates a new `Constraint`, with the specified 'Name', and appends it to the 'Owned Rule' containment reference list.

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

### getOwnedRule

    Constraint getOwnedRule(java.lang.String name)

  Retrieves the first `Constraint` with the specified 'Name' from the 'Owned Rule' 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:
    `getOwnedRules()`

### getOwnedRule

    Constraint getOwnedRule(java.lang.String name,
                            boolean ignoreCase,
                            org.eclipse.emf.ecore.EClass eClass,
                            boolean createOnDemand)

  Retrieves the first `Constraint` with the specified 'Name' from the 'Owned Rule' 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:
    `getOwnedRules()`

### getMembers

    org.eclipse.emf.common.util.EList<NamedElement> getMembers()

  Returns the value of the 'Member' reference list. The list contents are of type `NamedElement`. This feature is a derived union. A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance.

  Returns:
    the value of the 'Member' reference list.
  See Also:
    `UMLPackage.getNamespace_Member()`

### getMember

    NamedElement getMember(java.lang.String name)

  Retrieves the first `NamedElement` with the specified 'Name' from the 'Member' reference list.

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

### getMember

    NamedElement getMember(java.lang.String name,
                           boolean ignoreCase,
                           org.eclipse.emf.ecore.EClass eClass)

  Retrieves the first `NamedElement` with the specified 'Name' from the 'Member' reference list.

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

### getImportedMembers

    org.eclipse.emf.common.util.EList<PackageableElement> getImportedMembers()

  Returns the value of the 'Imported Member' reference list. The list contents are of type `PackageableElement`.

  This feature subsets the following features:

  - '`Member`'
  References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports.

  Returns:
    the value of the 'Imported Member' reference list.
  See Also:
    `UMLPackage.getNamespace_ImportedMember()`

### getImportedMember

    PackageableElement getImportedMember(java.lang.String name)

  Retrieves the first `PackageableElement` with the specified 'Name' from the 'Imported Member' reference list.

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

### getImportedMember

    PackageableElement getImportedMember(java.lang.String name,
                                         boolean ignoreCase,
                                         org.eclipse.emf.ecore.EClass eClass)

  Retrieves the first `PackageableElement` with the specified 'Name' from the 'Imported Member' reference list.

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

### getOwnedMembers

    org.eclipse.emf.common.util.EList<NamedElement> getOwnedMembers()

  Returns the value of the 'Owned Member' reference list. The list contents are of type `NamedElement`. It is bidirectional and its opposite is '`Namespace`'.

  This feature subsets the following features:

  - '`Member`'
  - '`Owned Element`'
  This feature is a derived union. A collection of NamedElements owned by the Namespace.

  Returns:
    the value of the 'Owned Member' reference list.
  See Also:
    `UMLPackage.getNamespace_OwnedMember()`, `NamedElement.getNamespace()`

### getOwnedMember

    NamedElement getOwnedMember(java.lang.String name)

  Retrieves the first `NamedElement` with the specified 'Name' from the 'Owned Member' reference list.

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

### getOwnedMember

    NamedElement getOwnedMember(java.lang.String name,
                                boolean ignoreCase,
                                org.eclipse.emf.ecore.EClass eClass)

  Retrieves the first `NamedElement` with the specified 'Name' from the 'Owned Member' reference list.

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

### validateMembersDistinguishable

    boolean validateMembersDistinguishable(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                           java.util.Map<java.lang.Object,java.lang.Object> context)

  All the members of a Namespace are distinguishable within it. membersAreDistinguishable()

  Parameters:
    `diagnostics` - The chain of diagnostics to which problems are to be appended.
    `context` - The cache of context-specific information.

### createElementImport

    ElementImport createElementImport(PackageableElement element,
                                      VisibilityKind visibility)

  Creates an import of the specified element into this namespace with the specified visibility.

  Parameters:
    `element` - The element to import.
    `visibility` - The visibility for the new element import.

### createPackageImport

    PackageImport createPackageImport(Package package_,
                                      VisibilityKind visibility)

  Creates an import of the specified package into this namespace with the specified visibility.

  Parameters:
    `package_` - The package to import.
    `visibility` - The visibility for the new package import.

### getImportedElements

    org.eclipse.emf.common.util.EList<PackageableElement> getImportedElements()

  Retrieves the elements imported by this namespace.

### getImportedPackages

    org.eclipse.emf.common.util.EList<Package> getImportedPackages()

  Retrieves the packages imported by this namespace.

### getNamesOfMember

    org.eclipse.emf.common.util.EList<java.lang.String> getNamesOfMember(NamedElement element)

  The query getNamesOfMember() takes importing into account. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package. The query getNamesOfMember() gives a set of all of the names that a member would have in a Namespace. In general a member can have multiple names in a Namespace if it is imported more than once with different aliases. The query takes account of importing. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package. result = if self.ownedMember ->includes(element) then Set{}->include(element.name) else let elementImports: ElementImport = self.elementImport->select(ei | ei.importedElement = element) in if elementImports->notEmpty() then elementImports->collect(el | el.getName()) else self.packageImport->select(pi | pi.importedPackage.visibleMembers()->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element)) endif endif

### membersAreDistinguishable

    boolean membersAreDistinguishable()

  The Boolean query membersAreDistinguishable() determines whether all of the namespace's members are distinguishable within it. result = self.member->forAll( memb | self.member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self)))

### importMembers

    org.eclipse.emf.common.util.EList<PackageableElement> importMembers(org.eclipse.emf.common.util.EList<PackageableElement> imps)

  The query importMembers() defines which of a set of PackageableElements are actually imported into the namespace. This excludes hidden ones, i.e., those which have names that conflict with names of owned members, and also excludes elements which would have the same name when imported. result = self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self)))

### excludeCollisions

    org.eclipse.emf.common.util.EList<PackageableElement> excludeCollisions(org.eclipse.emf.common.util.EList<PackageableElement> imps)

  The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this namespace. result = imps->reject(imp1 | imps.exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))

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