com.ashridgetech.jamda.uml
Class NSUtil

java.lang.Object
  |
  +--com.ashridgetech.jamda.uml.NSUtil

public class NSUtil
extends java.lang.Object

Utility methods used with the NSUML classes.

Version:
1.0
Author:
paulb

Method Summary
static java.lang.String getId(ru.novosoft.uml.foundation.core.MModelElement me)
          Get the XMI id of an NSUML element
static int getLowerMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity multiplicity)
          Get the lower bound of any range of a multiplicity.
static int getUpperMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity multiplicity)
          Get the upper bound of any range of a multiplicity.
static boolean isMultiple(ru.novosoft.uml.foundation.data_types.MMultiplicity multiplicity)
          Show whether a multiplicity can have multiple instances, according to the following rules: if getLowerMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity) and getUpperMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity) both return StructuredType.UNBOUNDED, assume the multiplicity has not been specified and defaults to 1, so return false if getUpperMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity) is greater than 1, return true if getLowerMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity) is greater than or equal to zero, and getUpperMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity) is UNBOUNDED, return true
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getId

public static java.lang.String getId(ru.novosoft.uml.foundation.core.MModelElement me)
Get the XMI id of an NSUML element

Parameters:
me - the element of which the id is required
Returns:
the XMI id of the element

getLowerMultiplicity

public static int getLowerMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity multiplicity)
Get the lower bound of any range of a multiplicity.

Parameters:
multiplicity - the MMultiplicity of which the lower limit is required
Returns:
the lowest number of instances, or StructuredType.UNBOUNDED.

getUpperMultiplicity

public static int getUpperMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity multiplicity)
Get the upper bound of any range of a multiplicity.

Parameters:
multiplicity - the MMultiplicity of which the upper limit is required
Returns:
the greatest number of instances, or StructuredType.UNBOUNDED if there is no upper limit.

isMultiple

public static boolean isMultiple(ru.novosoft.uml.foundation.data_types.MMultiplicity multiplicity)
Show whether a multiplicity can have multiple instances, according to the following rules:

Parameters:
multiplicity - the MMultiplicity which may be multiple or not
Returns:
true if multiple instances are allowed.


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.