org.eclipse.uml2
Interface MultiplicityElement

All Superinterfaces:
Element, EModelElement, EObject, Notifier
All Known Subinterfaces:
ConnectorEnd, ExtensionEnd, InputPin, Operation, OutputPin, Parameter, Pin, Port, Property, StructuralFeature, ValuePin, Variable

public interface MultiplicityElement
extends Element

A representation of the model object 'Multiplicity Element'. A MultiplicityElement is an abstract metaclass which includes optional attributes for defining the bounds of a multiplicity. A MultiplicityElement also includes specifications of whether the values in an instantiation of this element must be unique or ordered.

The following features are supported:

See Also:
UML2Package.getMultiplicityElement()

Field Summary
static String copyright
           
static int UNLIMITED_UPPER_BOUND
           
 
Method Summary
 ValueSpecification createLowerValue(EClass eClass)
          Creates a ValueSpecification and sets the 'Lower Value' containment reference
 ValueSpecification createUpperValue(EClass eClass)
          Creates a ValueSpecification and sets the 'Upper Value' containment reference
 int getLower()
          Returns the value of the 'Lower' attribute.
 ValueSpecification getLowerValue()
          Returns the value of the 'Lower Value' containment reference
 EList getOwnedElements()
           
 int getUpper()
          Returns the value of the 'Upper' attribute.
 ValueSpecification getUpperValue()
          Returns the value of the 'Upper Value' containment reference
 boolean includesCardinality(int C)
           A query based on the following OCL expression: (lowerBound() <= C) and (upperBound() >= C)
 boolean includesMultiplicity(MultiplicityElement M)
           A query based on the following OCL expression: (self.lowerBound() <= M.lowerBound()) and (self.upperBound() >= M.upperBound())
 boolean isMultivalued()
           A query based on the following OCL expression: upperBound() > 1
 boolean isOrdered()
          Returns the value of the 'Is Ordered' attribute.
 boolean isUnique()
          Returns the value of the 'Is Unique' attribute.
 int lower()
           A query based on the following OCL expression: lowerBound()
 int lowerBound()
           A query based on the following OCL expression: if lowerValue->isEmpty() then 1 else lowerValue.integerValue() endif
 void setIsOrdered(boolean value)
          Sets the value of the 'Is Ordered' attribute
 void setIsUnique(boolean value)
          Sets the value of the 'Is Unique' attribute
 void setLowerBound(int value)
          Sets the lower bound to the specified integer value.
 void setLowerValue(ValueSpecification value)
          Sets the value of the 'Lower Value' containment reference
 void setUpperBound(int value)
          Sets the upper bound to the specified unlimited natural value.
 void setUpperValue(ValueSpecification value)
          Sets the value of the 'Upper Value' containment reference
 int upper()
           A query based on the following OCL expression: upperBound()
 int upperBound()
           A query based on the following OCL expression: if upperValue->isEmpty() then 1 else upperValue.unlimitedValue() endif
 boolean validateLowerEqLowerbound(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: lower=lowerBound()
 boolean validateLowerGe0(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: lowerBound()->notEmpty() implies lowerBound() >= 0
 boolean validateUpperEqUpperbound(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: upper = upperBound()
 boolean validateUpperGeLower(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: (upperBound()->notEmpty() and lowerBound()->notEmpty()) implies upperBound() >= lowerBound()
 boolean validateUpperGt0(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: upperBound()->notEmpty() implies upperBound() > 0
 
Methods inherited from interface org.eclipse.uml2.Element
addKeyword, allOwnedElements, apply, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedVersion, getKeywords, getModel, getNearestPackage, getOwnedComments, getOwner, getValue, hasKeyword, isApplied, isRequired, mustBeOwned, removeKeyword, setValue, unapply, 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
 

Field Detail

copyright

public static final String copyright

See Also:
Constant Field Values

UNLIMITED_UPPER_BOUND

public static final int UNLIMITED_UPPER_BOUND
See Also:
Constant Field Values
Method Detail

isOrdered

public boolean isOrdered()
Returns the value of the 'Is Ordered' attribute. The default value is "false".

If the meaning of the 'Is Ordered' attribute isn't clear, there really should be more of a description here...

For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this element are sequentially ordered. Default is false.

Returns:
the value of the 'Is Ordered' attribute.
See Also:
setIsOrdered(boolean), UML2Package.getMultiplicityElement_IsOrdered()

setIsOrdered

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

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

isUnique

public boolean isUnique()
Returns the value of the 'Is Unique' attribute. The default value is "true".

If the meaning of the 'Is Unique' attribute isn't clear, there really should be more of a description here...

For a multivalued multiplicity, this attributes specifies whether the values in an instantiation of this element are unique. Default is true.

Returns:
the value of the 'Is Unique' attribute.
See Also:
setIsUnique(boolean), UML2Package.getMultiplicityElement_IsUnique()

setIsUnique

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

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

getLower

public int getLower()
Returns the value of the 'Lower' attribute. The default value is "1".

If the meaning of the 'Lower' attribute isn't clear, there really should be more of a description here...

Specifies the lower bound of the multiplicity interval, if it is expressed as an integer.

Returns:
the value of the 'Lower' attribute.
See Also:
UML2Package.getMultiplicityElement_Lower()

getUpper

public int getUpper()
Returns the value of the 'Upper' attribute. The default value is "1".

If the meaning of the 'Upper' attribute isn't clear, there really should be more of a description here...

Specifies the upper bound of the multiplicity interval, if it is expressed as an unlimited natural.

Returns:
the value of the 'Upper' attribute.
See Also:
UML2Package.getMultiplicityElement_Upper()

getUpperValue

public ValueSpecification getUpperValue()
Returns the value of the 'Upper Value' containment reference.

If the meaning of the 'Upper Value' containment reference isn't clear, there really should be more of a description here...

The specification of the upper bound for this multiplicity. Subsets Element::ownedElement.

Returns:
the value of the 'Upper Value' containment reference.
See Also:
setUpperValue(ValueSpecification), UML2Package.getMultiplicityElement_UpperValue()

setUpperValue

public void setUpperValue(ValueSpecification value)
Sets the value of the 'Upper Value' containment reference.

Parameters:
value - the new value of the 'Upper Value' containment reference.
See Also:
getUpperValue()

createUpperValue

public ValueSpecification createUpperValue(EClass eClass)
Creates a ValueSpecification and sets the 'Upper Value' containment reference.

Parameters:
eClass - The Ecore class of the ValueSpecification to create.
Returns:
The new ValueSpecification.
See Also:
getUpperValue()

getLowerValue

public ValueSpecification getLowerValue()
Returns the value of the 'Lower Value' containment reference.

If the meaning of the 'Lower Value' containment reference isn't clear, there really should be more of a description here...

The specification of the lower bound for this multiplicity. Subsets Element::ownedElement.

Returns:
the value of the 'Lower Value' containment reference.
See Also:
setLowerValue(ValueSpecification), UML2Package.getMultiplicityElement_LowerValue()

setLowerValue

public void setLowerValue(ValueSpecification value)
Sets the value of the 'Lower Value' containment reference.

Parameters:
value - the new value of the 'Lower Value' containment reference.
See Also:
getLowerValue()

createLowerValue

public ValueSpecification createLowerValue(EClass eClass)
Creates a ValueSpecification and sets the 'Lower Value' containment reference.

Parameters:
eClass - The Ecore class of the ValueSpecification to create.
Returns:
The new ValueSpecification.
See Also:
getLowerValue()

lowerBound

public int lowerBound()
A query based on the following OCL expression: if lowerValue->isEmpty() then 1 else lowerValue.integerValue() endif


upperBound

public int upperBound()
A query based on the following OCL expression: if upperValue->isEmpty() then 1 else upperValue.unlimitedValue() endif


isMultivalued

public boolean isMultivalued()
A query based on the following OCL expression: upperBound() > 1


includesCardinality

public boolean includesCardinality(int C)
A query based on the following OCL expression: (lowerBound() <= C) and (upperBound() >= C)


includesMultiplicity

public boolean includesMultiplicity(MultiplicityElement M)
A query based on the following OCL expression: (self.lowerBound() <= M.lowerBound()) and (self.upperBound() >= M.upperBound())


validateUpperGt0

public boolean validateUpperGt0(DiagnosticChain diagnostics,
                                Map context)
An invariant constraint based on the following OCL expression: upperBound()->notEmpty() implies upperBound() > 0


validateLowerGe0

public boolean validateLowerGe0(DiagnosticChain diagnostics,
                                Map context)
An invariant constraint based on the following OCL expression: lowerBound()->notEmpty() implies lowerBound() >= 0


validateUpperGeLower

public boolean validateUpperGeLower(DiagnosticChain diagnostics,
                                    Map context)
An invariant constraint based on the following OCL expression: (upperBound()->notEmpty() and lowerBound()->notEmpty()) implies upperBound() >= lowerBound()


validateLowerEqLowerbound

public boolean validateLowerEqLowerbound(DiagnosticChain diagnostics,
                                         Map context)
An invariant constraint based on the following OCL expression: lower=lowerBound()


validateUpperEqUpperbound

public boolean validateUpperEqUpperbound(DiagnosticChain diagnostics,
                                         Map context)
An invariant constraint based on the following OCL expression: upper = upperBound()


lower

public int lower()
A query based on the following OCL expression: lowerBound()


upper

public int upper()
A query based on the following OCL expression: upperBound()


getOwnedElements

public EList getOwnedElements()

Specified by:
getOwnedElements in interface Element
Returns:
the value of the 'Owned Element' reference list.
See Also:
UML2Package.getElement_OwnedElement(), Element.getOwner()

setLowerBound

public void setLowerBound(int value)
Sets the lower bound to the specified integer value.

Parameters:
value - The new value of the lower bound.
Throws:
IllegalArgumentException - If the new lower bound is invalid.
See Also:
lowerBound()

setUpperBound

public void setUpperBound(int value)
Sets the upper bound to the specified unlimited natural value.

Parameters:
value - The new value of the upper bound.
Throws:
IllegalArgumentException - If the new upper bound is invalid.
See Also:
upperBound()

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