Data Request Broker
2-3-release

fr.gael.drb.value
Interface Value

All Superinterfaces:
DrbItem
All Known Subinterfaces:
Numeric, NumericArray, ValueArray
All Known Implementing Classes:
AbstractNumericArray, AbstractValueArray, Binary, BinaryInteger, Boolean, BooleanArray, Byte, ByteArray, DateTime, DayTimeDuration, Decimal, DefaultValueArray, Double, DoubleArray, Duration, Float, FloatArray, Int, IntArray, Integer, Long, LongArray, Short, ShortArray, String, UnsignedByte, UnsignedByteArray, UnsignedInt, UnsignedIntArray, UnsignedLong, UnsignedLongArray, UnsignedShort, UnsignedShortArray, YearMonthDuration

public interface Value
extends DrbItem

Generic value wrapper for multiple purposes. This class allows easy evaluation of various kinds of expressions :

There is no need to know the real type embedded in the value. If required an implicit conversion will be performed at run-time. It is also possible to perform an explicit conversion to any desired type. Each value has an unique type identifier (ID) associated with it. Two value of same type must also have the same ID. A range of ID defined below is reserved to identify primitive. The other ID can be freely used.


Field Summary
static int ARRAY_ID
          Array value identifier.
static int BINARY_ID
          Binary value identifier.
static int BINARY_INTEGER_ID
          BinaryInteger value identifier.
static int BOOLEAN_ID
          Boolean value identifier.
static int BYTE_ID
          Byte value identifier.
static int DATE_ID
          Date value identifier.
static int DATE_TIME_ID
          Date/Time value identifier.
static int DAY_ID
          Day value identifier.
static int DAY_TIME_DURATION_ID
          Day/Time duration value identifier.
static int DECIMAL_ID
          Decimal value identifier.
static int DOUBLE_ID
          Double value identifier.
static int DURATION_ID
          Duration value identifier.
static int FLOAT_ID
          Float value identifier.
static int INT_ID
          Int value identifier.
static int INTEGER_ID
          Integer value identifier.
static int LONG_ID
          Long value identifier.
static int MONTH_DAY_ID
          Month/Day value identifier.
static int MONTH_ID
          Month value identifier.
static int NULL_ID
          NULL value identifier.
static int NUMERIC_ID
          Numeric value identifier.
static int OTHER_ID
          Other value identifier.
static int SHORT_ID
          Short value identifier.
static int STRING_ID
          String value identifier.
static int TIME_ID
          Time value identifier.
static int UNKNOWN_ID
          UNKNOWN value identifier.
static int UNSIGNED_BYTE_ID
          UnsignedByte value identifier.
static int UNSIGNED_INT_ID
          UnsignedInt value identifier.
static int UNSIGNED_LONG_ID
          UnsignedLong value identifier.
static int UNSIGNED_SHORT_ID
          UnsignedShort value identifier.
static int YEAR_ID
          Year value identifier.
static int YEAR_MONTH_DURATION_ID
          Year/Month duration value identifier.
static int YEAR_MONTH_ID
          Year/Month value identifier.
 
Fields inherited from interface fr.gael.drb.DrbItem
ATTRIBUTE_ITEM, NODE_ITEM, UNDEFINED_ITEM, VALUE_ITEM
 
Method Summary
 void assign(Value v)
          Assign a new Value.
 Value convertTo(int type)
          Convert the value into the specified type.
 int getPriority()
          The absolute priority of the value.
 int getType()
          The type identifier of the value.
 
Methods inherited from interface fr.gael.drb.DrbItem
getItemType, getName, getNamespaceURI, getValue, rename, setNamespaceURI, setValue
 

Field Detail

UNKNOWN_ID

static final int UNKNOWN_ID
UNKNOWN value identifier.

See Also:
Constant Field Values

NULL_ID

static final int NULL_ID
NULL value identifier.

See Also:
Constant Field Values

BOOLEAN_ID

static final int BOOLEAN_ID
Boolean value identifier.

See Also:
Constant Field Values

BYTE_ID

static final int BYTE_ID
Byte value identifier.

See Also:
Constant Field Values

SHORT_ID

static final int SHORT_ID
Short value identifier.

See Also:
Constant Field Values

INT_ID

static final int INT_ID
Int value identifier.

See Also:
Constant Field Values

LONG_ID

static final int LONG_ID
Long value identifier.

See Also:
Constant Field Values

FLOAT_ID

static final int FLOAT_ID
Float value identifier.

See Also:
Constant Field Values

DOUBLE_ID

static final int DOUBLE_ID
Double value identifier.

See Also:
Constant Field Values

STRING_ID

static final int STRING_ID
String value identifier.

See Also:
Constant Field Values

DATE_ID

static final int DATE_ID
Date value identifier.

See Also:
Constant Field Values

NUMERIC_ID

static final int NUMERIC_ID
Numeric value identifier.

See Also:
Constant Field Values

ARRAY_ID

static final int ARRAY_ID
Array value identifier.

See Also:
Constant Field Values

BINARY_INTEGER_ID

static final int BINARY_INTEGER_ID
BinaryInteger value identifier.

See Also:
Constant Field Values

UNSIGNED_BYTE_ID

static final int UNSIGNED_BYTE_ID
UnsignedByte value identifier.

See Also:
Constant Field Values

UNSIGNED_SHORT_ID

static final int UNSIGNED_SHORT_ID
UnsignedShort value identifier.

See Also:
Constant Field Values

UNSIGNED_INT_ID

static final int UNSIGNED_INT_ID
UnsignedInt value identifier.

See Also:
Constant Field Values

UNSIGNED_LONG_ID

static final int UNSIGNED_LONG_ID
UnsignedLong value identifier.

See Also:
Constant Field Values

DURATION_ID

static final int DURATION_ID
Duration value identifier.

See Also:
Constant Field Values

DAY_TIME_DURATION_ID

static final int DAY_TIME_DURATION_ID
Day/Time duration value identifier.

See Also:
Constant Field Values

YEAR_MONTH_DURATION_ID

static final int YEAR_MONTH_DURATION_ID
Year/Month duration value identifier.

See Also:
Constant Field Values

YEAR_ID

static final int YEAR_ID
Year value identifier.

See Also:
Constant Field Values

YEAR_MONTH_ID

static final int YEAR_MONTH_ID
Year/Month value identifier.

See Also:
Constant Field Values

MONTH_ID

static final int MONTH_ID
Month value identifier.

See Also:
Constant Field Values

MONTH_DAY_ID

static final int MONTH_DAY_ID
Month/Day value identifier.

See Also:
Constant Field Values

DAY_ID

static final int DAY_ID
Day value identifier.

See Also:
Constant Field Values

DATE_TIME_ID

static final int DATE_TIME_ID
Date/Time value identifier.

See Also:
Constant Field Values

TIME_ID

static final int TIME_ID
Time value identifier.

See Also:
Constant Field Values

DECIMAL_ID

static final int DECIMAL_ID
Decimal value identifier.

See Also:
Constant Field Values

INTEGER_ID

static final int INTEGER_ID
Integer value identifier.

See Also:
Constant Field Values

BINARY_ID

static final int BINARY_ID
Binary value identifier.

See Also:
Constant Field Values

OTHER_ID

static final int OTHER_ID
Other value identifier.

See Also:
Constant Field Values
Method Detail

getType

int getType()
The type identifier of the value.

Returns:
an identifier of the value type.

convertTo

Value convertTo(int type)
                throws ClassCastException
Convert the value into the specified type. In case of identity conversion the value itself should be returned. If the conversion is not allowed a ClassCastException is thrown.

Parameters:
type - The target type.
Returns:
The converted value.
Throws:
ClassCastException - the exception

assign

void assign(Value v)
Assign a new Value. An implicit conversion may be performed to make the assignment. This assignment may result in a loss of precision (ex : float to int).

Parameters:
v - the value to be assigned.

getPriority

int getPriority()
The absolute priority of the value.

Returns:
The value priority.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .