org.eclipse.ocl.examples.pivot.internal.operations
Class MultiplicityElementOperations

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.internal.operations.MonikeredElementOperations
      extended by org.eclipse.ocl.examples.pivot.internal.operations.MultiplicityElementOperations

public class MultiplicityElementOperations
extends MonikeredElementOperations

A static utility class that provides operations related to 'Multiplicity Element' model objects.

The following operations are supported:

Generated

Constructor Summary
protected MultiplicityElementOperations()
           
 
Method Summary
static boolean includesCardinality(MultiplicityElement multiplicityElement, java.math.BigInteger C)
          The query includesCardinality() checks whether the specified cardinality is valid for this multiplicity.
static boolean includesMultiplicity(MultiplicityElement multiplicityElement, MultiplicityElement M)
          The query includesMultiplicity() checks whether this multiplicity includes all the cardinalities allowed by the specified multiplicity.
static boolean isMultivalued(MultiplicityElement multiplicityElement)
          The query isMultivalued() checks whether this multiplicity has an upper bound greater than one.
static java.math.BigInteger lowerBound(MultiplicityElement multiplicityElement)
          The query lowerBound() returns the lower bound of the multiplicity as an integer.
static java.math.BigInteger upperBound(MultiplicityElement multiplicityElement)
          The query upperBound() returns the upper bound of the multiplicity for a bounded multiplicity as an unlimited natural.
static boolean validateLowerGe0(MultiplicityElement multiplicityElement, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The lower bound must be a non-negative integer literal.
static boolean validateUpperGeLower(MultiplicityElement multiplicityElement, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The upper bound must be greater than or equal to the lower bound.
 
Methods inherited from class org.eclipse.ocl.examples.pivot.internal.operations.MonikeredElementOperations
hasMoniker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiplicityElementOperations

protected MultiplicityElementOperations()

Generated
Method Detail

validateLowerGe0

public static boolean validateLowerGe0(MultiplicityElement multiplicityElement,
                                       org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                       java.util.Map<java.lang.Object,java.lang.Object> context)
The lower bound must be a non-negative integer literal. lowerBound()->notEmpty() implies lowerBound() >= 0

Parameters:
multiplicityElement - The receiving 'Multiplicity Element' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.
Generated

validateUpperGeLower

public static boolean validateUpperGeLower(MultiplicityElement multiplicityElement,
                                           org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                           java.util.Map<java.lang.Object,java.lang.Object> context)
The upper bound must be greater than or equal to the lower bound. (upperBound()->notEmpty() and lowerBound()->notEmpty()) implies upperBound() >= lowerBound()

Parameters:
multiplicityElement - The receiving 'Multiplicity Element' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.
Generated

lowerBound

public static java.math.BigInteger lowerBound(MultiplicityElement multiplicityElement)
The query lowerBound() returns the lower bound of the multiplicity as an integer. result = if lower->notEmpty() then lower else 1 endif

Parameters:
multiplicityElement - The receiving 'Multiplicity Element' model object.
Generated

upperBound

public static java.math.BigInteger upperBound(MultiplicityElement multiplicityElement)
The query upperBound() returns the upper bound of the multiplicity for a bounded multiplicity as an unlimited natural. result = if upper->notEmpty() then upper else 1 endif

Parameters:
multiplicityElement - The receiving 'Multiplicity Element' model object.
Generated

isMultivalued

public static boolean isMultivalued(MultiplicityElement multiplicityElement)
The query isMultivalued() checks whether this multiplicity has an upper bound greater than one. upperBound()->notEmpty() result = upperBound() > 1

Parameters:
multiplicityElement - The receiving 'Multiplicity Element' model object.
Generated

includesCardinality

public static boolean includesCardinality(MultiplicityElement multiplicityElement,
                                          java.math.BigInteger C)
The query includesCardinality() checks whether the specified cardinality is valid for this multiplicity. upperBound()->notEmpty() and lowerBound()->notEmpty() result = (lowerBound() <= C) and (upperBound() >= C)

Parameters:
multiplicityElement - The receiving 'Multiplicity Element' model object.
Generated

includesMultiplicity

public static boolean includesMultiplicity(MultiplicityElement multiplicityElement,
                                           MultiplicityElement M)
The query includesMultiplicity() checks whether this multiplicity includes all the cardinalities allowed by the specified multiplicity. self.upperBound()->notEmpty() and self.lowerBound()->notEmpty() and M.upperBound()->notEmpty() and M.lowerBound()->notEmpty() result = (self.lowerBound() <= M.lowerBound()) and (self.upperBound() >= M.upperBound())

Parameters:
multiplicityElement - The receiving 'Multiplicity Element' model object.
Generated