javawrapper.ModelEnum Class Reference

Packages a data value with other information. More...

Inheritance diagram for javawrapper.ModelEnum:

javawrapper.ModelData

List of all members.

Public Member Functions

 ModelEnum (int[] p_iAllowedValues, String[] p_sValueLabels, String sDescriptor, String sXMLTag)
 Constructor.
String toString ()
 Required overridden method.
void SetValue (int iValue) throws ModelException
 Sets the value.
void SetValue (String sValue) throws ModelException
 Sets the value using one of the string literals.
int GetValue ()
 Gets the integer value.
String GetStringValue ()
 Get the string label corresponding to the current integer value.
int[] GetAllowedValues ()
 Gets the set of all allowed values.
String[] GetAllowedValueLabels ()
 Gets the set of allowed value labels.
boolean equals (Object oTest)
 Overriding equality tester.
Object clone ()
 Clones this object.

Protected Attributes

int m_iValue
 Variable's value.
int[] mp_iAllowedValues
 Set of allowed values.
String[] mp_sValueLabels
 Label to display for each value.


Detailed Description

Packages a data value with other information.

This object has a limited number of values it can accept.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

Constructor & Destructor Documentation

javawrapper.ModelEnum.ModelEnum ( int[]  p_iAllowedValues,
String[]  p_sValueLabels,
String  sDescriptor,
String  sXMLTag 
)

Constructor.

Parameters:
p_iAllowedValues Allowed values.
p_sValueLabels Text label for each allowed value. Optional.
sDescriptor Descriptor string.
sXMLTag The XML tag associated with this piece of data.


Member Function Documentation

String javawrapper.ModelEnum.toString (  )  [virtual]

Required overridden method.

Returns:
String representation of the value.

Implements javawrapper.ModelData.

void javawrapper.ModelEnum.SetValue ( int  iValue  )  throws ModelException

Sets the value.

Parameters:
iValue Value to set.
Exceptions:
ModelException if the value is not an allowed value.

void javawrapper.ModelEnum.SetValue ( String  sValue  )  throws ModelException

Sets the value using one of the string literals.

Parameters:
sValue String value.
Exceptions:
ModelException if the string literal does not correspond to an allowed value.

int javawrapper.ModelEnum.GetValue (  ) 

Gets the integer value.

Returns:
The integer value.

String javawrapper.ModelEnum.GetStringValue (  ) 

Get the string label corresponding to the current integer value.

Returns:
String label for the current integer value.

int [] javawrapper.ModelEnum.GetAllowedValues (  ) 

Gets the set of all allowed values.

Returns:
The set of allowed values.

String [] javawrapper.ModelEnum.GetAllowedValueLabels (  ) 

Gets the set of allowed value labels.

Returns:
The set of allowed value labels.

boolean javawrapper.ModelEnum.equals ( Object  oTest  ) 

Overriding equality tester.

Parameters:
oTest Object to test for equality
Returns:
true if the objects have equal values, false if not.

Object javawrapper.ModelEnum.clone (  ) 

Clones this object.

Returns:
Object


Member Data Documentation

Variable's value.

Set of allowed values.

Label to display for each value.


The documentation for this class was generated from the following file:

Generated on Wed Oct 28 14:01:21 2009 for SORTIE Java Interface by  doxygen 1.5.6