com.davisor.data
Interface NumberType

All Superinterfaces:
com.davisor.core.Dupable
All Known Implementing Classes:
RelativeTimestampType, SimpleNumberType

public interface NumberType
extends com.davisor.core.Dupable

NumberType defines a base interface for all data types that manipulatae simple numeric values. As with all the other types, one of the main functions of all classes that implement NumberType is to convert number strings to number objects and back.

This interface defines the following operation sets:

The principal reference implementation for this interface is the SimpleNumberType clas.

Since:
JDK1.2
See Also:
NumberValue

Method Summary
 byte byteValue(byte value)
          Converts a byte value to an another byte value.
 byte byteValue(java.lang.String value, java.text.ParsePosition status)
          Converts a string to a byte value.
 double doubleValue(double value)
          Converts a double value to an another double value.
 double doubleValue(java.lang.String value, java.text.ParsePosition status)
          Converts a string to a double value.
 float floatValue(float value)
          Converts a float value to an another float value.
 float floatValue(java.lang.String value, java.text.ParsePosition status)
          Converts a string to a float value.
 int intValue(int value)
          Converts a integer value to an another int value.
 int intValue(java.lang.String value, java.text.ParsePosition status)
          Converts a string to a int value.
 long longValue(long value)
          Converts a long value to an another long value.
 long longValue(java.lang.String value, java.text.ParsePosition status)
          Converts a string to a long value.
 java.lang.Number numberValue(java.lang.String value, java.text.ParsePosition status)
          Converts a string to a Number value.
 short shortValue(short value)
          Converts a short value to an another short value.
 short shortValue(java.lang.String value, java.text.ParsePosition status)
          Converts a string to a short value.
 java.lang.String stringValue(byte value)
          Converts a byte value to a string.
 java.lang.String stringValue(double value)
          Converts a double value to a string.
 java.lang.String stringValue(float value)
          Converts a float value to a string.
 java.lang.String stringValue(int value)
          Converts an integer value to a string.
 java.lang.String stringValue(long value)
          Converts a long value to a string.
 java.lang.String stringValue(java.lang.Number value)
          Converts a Number value to a string.
 java.lang.String stringValue(short value)
          Converts a short value to a string.
 
Methods inherited from interface com.davisor.core.Dupable
dup
 

Method Detail

byteValue

public byte byteValue(java.lang.String value,
                      java.text.ParsePosition status)
               throws InvalidDataException
Converts a string to a byte value.

Parameters:
value - the string to be converted
status - parse status (may be null)
Returns:
byte value
Throws:
InvalidDataException - if the value cannot be converted to a byte value.

doubleValue

public double doubleValue(java.lang.String value,
                          java.text.ParsePosition status)
                   throws InvalidDataException
Converts a string to a double value.

Parameters:
value - the string to be converted
status - parse status (may be null)
Returns:
double value
Throws:
InvalidDataException - if the value cannot be converted to a double value.

floatValue

public float floatValue(java.lang.String value,
                        java.text.ParsePosition status)
                 throws InvalidDataException
Converts a string to a float value.

Parameters:
value - the string to be converted
status - parse status (may be null)
Returns:
float value
Throws:
InvalidDataException - if the value cannot be converted to a float value.

intValue

public int intValue(java.lang.String value,
                    java.text.ParsePosition status)
             throws InvalidDataException
Converts a string to a int value.

Parameters:
value - the string to be converted
status - parse status (may be null)
Returns:
integer value
Throws:
InvalidDataException - if the value cannot be converted to a int value.

longValue

public long longValue(java.lang.String value,
                      java.text.ParsePosition status)
               throws InvalidDataException
Converts a string to a long value.

Parameters:
value - the string to be converted
status - parse status (may be null)
Returns:
long value
Throws:
InvalidDataException - if the value cannot be converted to a long value.

numberValue

public java.lang.Number numberValue(java.lang.String value,
                                    java.text.ParsePosition status)
                             throws InvalidDataException
Converts a string to a Number value.

Parameters:
value - the string to be converted (may be null)
status - parse status (may be null)
Returns:
Number value, or null
Throws:
InvalidDataException - if the value cannot be converted to a long value.

shortValue

public short shortValue(java.lang.String value,
                        java.text.ParsePosition status)
                 throws InvalidDataException
Converts a string to a short value.

Parameters:
value - the string to be converted
status - parse status (may be null)
Returns:
short value
Throws:
InvalidDataException - if the value cannot be converted to a short value.

stringValue

public java.lang.String stringValue(byte value)
                             throws InvalidDataException
Converts a byte value to a string.

Parameters:
value - the value to be converted
Throws:
InvalidDataException - if the value cannot be converted

stringValue

public java.lang.String stringValue(double value)
                             throws InvalidDataException
Converts a double value to a string.

Parameters:
value - the value to be converted
Throws:
InvalidDataException - if the value cannot be converted

stringValue

public java.lang.String stringValue(float value)
                             throws InvalidDataException
Converts a float value to a string.

Parameters:
value - the value to be converted
Throws:
InvalidDataException - if the value cannot be converted

stringValue

public java.lang.String stringValue(int value)
                             throws InvalidDataException
Converts an integer value to a string.

Parameters:
value - the value to be converted
Throws:
InvalidDataException - if the value cannot be converted

stringValue

public java.lang.String stringValue(long value)
                             throws InvalidDataException
Converts a long value to a string.

Parameters:
value - the value to be converted
Throws:
InvalidDataException - if the value cannot be converted

stringValue

public java.lang.String stringValue(short value)
                             throws InvalidDataException
Converts a short value to a string.

Parameters:
value - the value to be converted
Throws:
InvalidDataException - if the value cannot be converted

stringValue

public java.lang.String stringValue(java.lang.Number value)
                             throws InvalidDataException
Converts a Number value to a string.

Parameters:
value - the value to be converted
Throws:
InvalidDataException - if the value cannot be converted

byteValue

public byte byteValue(byte value)
Converts a byte value to an another byte value.

Parameters:
value - the value to be converted

doubleValue

public double doubleValue(double value)
Converts a double value to an another double value.

Parameters:
value - the value to be converted

floatValue

public float floatValue(float value)
Converts a float value to an another float value.

Parameters:
value - the value to be converted

intValue

public int intValue(int value)
Converts a integer value to an another int value.

Parameters:
value - the value to be converted

longValue

public long longValue(long value)
Converts a long value to an another long value.

Parameters:
value - the value to be converted

shortValue

public short shortValue(short value)
Converts a short value to an another short value.

Parameters:
value - the value to be converted


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