net.sf.farrago.cwm.datatypes
Interface CwmEnumerationLiteral

All Superinterfaces:
CwmElement, CwmModelElement, RefBaseObject, RefFeatured, RefObject
All Known Implementing Classes:
CwmEnumerationLiteral$Hib

public interface CwmEnumerationLiteral
extends CwmModelElement

EnumerationLiteral object instance interface. EnumerationLiteral instances describe the enumeration identifiers, and possibly the values, associated with an enumerated data type. Enumeration identifiers are contained in the name attribute derived from the EnumerationLiteral instance?s ModelElement superclass. EnumerationLiteral instances may also be used to define expression-based values such as ranges. To do so, simply state the membership expression in the instance?s value. For example, a range literal can be created by setting the value attribute to "m..n", where m represents the lower bound of the range, and n, the upper bound. In this way, ranges and other more complicated expressions can be intermixed with simple enumeration literals. For example, an enumeration might contain the literals "1", "2", "4..7", and "> 10". Consequently, a simple range data type can be created with an Enumeration instance that owns a single EnumerationLiteral instance. For example, a data type for positive integers could be created as shown in the following instance diagram. A model attribute of this data type might then be declared as "posInt : PositiveInteger".

Note: This type should not be subclassed, implemented or directly instantiated by clients. It is generated from a MOF metamodel and implemented by Enki or MDR.


Method Summary
 CwmEnumeration getEnumeration()
          Returns the value of reference enumeration.
 CwmExpression getValue()
          Returns the value of attribute value.
 void setEnumeration(CwmEnumeration newValue)
          Sets the value of enumeration reference.
 void setValue(CwmExpression newValue)
          Sets the value of value attribute.
 
Methods inherited from interface net.sf.farrago.cwm.core.CwmModelElement
getClientDependency, getConstraint, getImporter, getName, getNamespace, getVisibility, setName, setNamespace, setVisibility
 
Methods inherited from interface javax.jmi.reflect.RefObject
refClass, refDelete, refImmediateComposite, refIsInstanceOf, refOutermostComposite
 
Methods inherited from interface javax.jmi.reflect.RefFeatured
refGetValue, refGetValue, refInvokeOperation, refInvokeOperation, refSetValue, refSetValue
 
Methods inherited from interface javax.jmi.reflect.RefBaseObject
equals, hashCode, refImmediatePackage, refMetaObject, refMofId, refOutermostPackage, refVerifyConstraints
 

Method Detail

getValue

CwmExpression getValue()
Returns the value of attribute value. The value associated with an enumeration identifier can be stored here. The attribute is optional because enumeration literals are not required to have a specific, displayable value. This is indicated by either an empty value attribute or a value attribute value whose expression body attribute is a zero-length string.

Returns:
Value of attribute value.

setValue

void setValue(CwmExpression newValue)
Sets the value of value attribute. See getValue() for description on the attribute.

Parameters:
newValue - New value to be set.

getEnumeration

CwmEnumeration getEnumeration()
Returns the value of reference enumeration.

Returns:
Value of reference enumeration.

setEnumeration

void setEnumeration(CwmEnumeration newValue)
Sets the value of enumeration reference. See getEnumeration() for description on the attribute.

Parameters:
newValue - New value to be set.