com.davisor.data
Class EnumData

java.lang.Object
  extended byjava.lang.Number
      extended bycom.davisor.data.SimpleNumberValue
          extended bycom.davisor.data.FloatData
              extended bycom.davisor.data.EnumData
All Implemented Interfaces:
java.lang.Comparable, Data, DataValue, com.davisor.core.Dupable, NumberValue, java.io.Serializable, SerializableData

public class EnumData
extends FloatData

An EnumData object represents enumerated data value. EnumData supports integer and fractional number values. In particular, EnumData inherits FloatData instead of for example IntegerData to allow manipulation and interpolation of fraction values. Fraction values are mapped to integer enumerated values by first trucating the fraction values to corresponding integer values, and then mapping the results to enumerated values.

Since:
JDK1.1
See Also:
EnumType, Serialized Form

Field Summary
 
Fields inherited from class com.davisor.data.SimpleNumberValue
M_type, M_value
 
Constructor Summary
EnumData(EnumData ed)
          Shallow copy constructor.
EnumData(EnumData ed, boolean deep)
          Deep or shallow copy constructor.
EnumData(EnumType type)
          Creates a new enumerated data object with the given enumeration type and default value (0).
EnumData(EnumType type, float value)
          Creates a new enumerated data object with the given enumeration type and value.
EnumData(EnumType type, int value)
          Creates a new enumerated data object with the given enumeration type and value.
EnumData(EnumType type, java.lang.Number value)
          Creates a new enumerated data object with the given enumeration type and value.
EnumData(EnumType type, java.lang.String stringValue, java.text.ParsePosition status)
          Creates a enum data value from a string value.
 
Method Summary
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
 
Methods inherited from class com.davisor.data.FloatData
abs, getFormat, negate, setValue, setValue, setValue, setValue, setValue, toStatement
 
Methods inherited from class com.davisor.data.SimpleNumberValue
add, byteValue, ceil, compareTo, deinterpolate, div, doubleValue, equals, floatValue, floor, getFormat, getType, hashCode, interpolate, intValue, isNull, longValue, max, min, mul, numberValue, setValue, setValue, setValue, shortValue, sub, toString, toXML, unit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumData

public EnumData(EnumData ed)
Shallow copy constructor.


EnumData

public EnumData(EnumData ed,
                boolean deep)
Deep or shallow copy constructor. If it is shallow, then the new object shares an underlying type with the original object. If it is deep, then the type is dupped.

Parameters:
ed - source data (may be null)
deep - determines if the copying is deep or shallow
See Also:
SimpleNumberValue.getType(), Type.dup()

EnumData

public EnumData(EnumType type)
Creates a new enumerated data object with the given enumeration type and default value (0).

Parameters:
type - enumerated type that provides the mapping between enumeration indexes and values.

EnumData

public EnumData(EnumType type,
                java.lang.Number value)
Creates a new enumerated data object with the given enumeration type and value.

Parameters:
type - enumerated type that provides mapping between enumeration indexes and values.

EnumData

public EnumData(EnumType type,
                float value)
Creates a new enumerated data object with the given enumeration type and value.

Parameters:
type - enumerated type that provides mapping between enumeration indexes and values.

EnumData

public EnumData(EnumType type,
                int value)
Creates a new enumerated data object with the given enumeration type and value.

Parameters:
type - enumerated type that provides mapping between enumeration indexes and values.

EnumData

public EnumData(EnumType type,
                java.lang.String stringValue,
                java.text.ParsePosition status)
         throws InvalidDataException
Creates a enum data value from a string value.

Parameters:
stringValue - string value to be parsed
status - parse status (may be null)
Throws:
InvalidDataException - if string value could not be parser
See Also:
FloatData.setValue(String,ParsePosition)
Method Detail

dup

public com.davisor.core.Dupable dup()
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
Overrides:
dup in class FloatData


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.