AR System Java API

com.bmc.arsys.api
Class Value

java.lang.Object
  extended by com.bmc.arsys.api.Value
All Implemented Interfaces:
Serializable, Cloneable

public class Value
extends Object
implements Cloneable, Serializable

The Value class represents the value information associated to a field.

See Also:
Serialized Form

Constructor Summary
Value()
          Create a AR_DATA_TYPE_NULL value.
Value(AttachmentValue v)
          Create a AR_DATA_TYPE_ATTACH value.
Value(BigDecimal bd)
          Create a AR_DATA_TYPE_DECIMAL value.
Value(ByteListValue b)
          Create a AR_DATA_TYPE_BYTES value.
Value(CurrencyValue c)
          Create a AR_DATA_TYPE_CURRENCY value.
Value(DateInfo d)
          Create a AR_DATA_TYPE_DATE value.
Value(DiaryListValue v)
          Create AR_DATA_TYPE_DIARY value
Value(double v)
          Create a AR_DATA_TYPE_REAL value.
Value(int v)
          Create a AR_DATA_TYPE_INTEGER value.
Value(Keyword v)
          Create a AR_DATA_TYPE_KEYWORD value.
Value(List<CoordinateInfo> v)
          Create a AR_DATA_TYPE_COORDS value
Value(long l)
          Create a AR_DATA_TYPE_ULONG value.
Value(Object val, DataType dt)
           
Value(String v)
          Create a AR_DATA_TYPE_CHAR value.
Value(String stringRepresentation, DataType valueType)
          Construct a value Object from a String representation and DataType.
Value(Time v)
          Create a AR_DATA_TYPE_TIME_OF_DAY value.
Value(Timestamp v)
          Create a AR_DATA_TYPE_TIME value.
 
Method Summary
 Object clone()
          Clone implementation that returns an Object with data cloned from self.
static Object convertFromARValue(Object[] arValue, boolean isStatusHistory, boolean preserveEnumTypeInfo)
           
static Object ConvertToARValue(Object val)
           
 boolean equals(Object obj)
          Use this method for checking equality of Value.
static int getARValueType(Object val)
           
 String getCurrencyValue()
           
 DataType getDataType()
          Returns the underlying Object's datatype DataType.
 double getDoubleValue()
           
 int getIntValue()
           
 Object getValue()
          Returns the underlying value as a generic Object.
 int hashCode()
          Returns the hash code value for this instance of the current class.
 String toString()
          Returns a string description of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Value

public Value()
Create a AR_DATA_TYPE_NULL value.


Value

public Value(String stringRepresentation,
             DataType valueType)
Construct a value Object from a String representation and DataType. Currently this function accepts the following data types:
INTEGER, REAL, CHAR, TIME (expecting Timestamp String which instanceof the number of seconds since January 1, 1970), BITMASK, DECIMAL, ULONG, ENUM

Data types not supported:

KEYWORD, DIARY, BYTES, ATTACHMENT, JOIN, TRIM, CONTROL, TABLE, COLUMN, PAGE, PAGE_HOLDER, COORDS

To build a Value Object holding data of the above types, use the default constructor and later call an appropriate Set method.

Throws:
IllegalArgumentException - if you use an unsupported data type

Value

public Value(Keyword v)
Create a AR_DATA_TYPE_KEYWORD value.


Value

public Value(int v)
Create a AR_DATA_TYPE_INTEGER value.


Value

public Value(double v)
Create a AR_DATA_TYPE_REAL value.


Value

public Value(String v)
Create a AR_DATA_TYPE_CHAR value.


Value

public Value(DiaryListValue v)
Create AR_DATA_TYPE_DIARY value


Value

public Value(long l)
Create a AR_DATA_TYPE_ULONG value.


Value

public Value(ByteListValue b)
Create a AR_DATA_TYPE_BYTES value.


Value

public Value(Timestamp v)
Create a AR_DATA_TYPE_TIME value.


Value

public Value(Time v)
Create a AR_DATA_TYPE_TIME_OF_DAY value.


Value

public Value(BigDecimal bd)
Create a AR_DATA_TYPE_DECIMAL value.


Value

public Value(CurrencyValue c)
Create a AR_DATA_TYPE_CURRENCY value.


Value

public Value(DateInfo d)
Create a AR_DATA_TYPE_DATE value.


Value

public Value(AttachmentValue v)
Create a AR_DATA_TYPE_ATTACH value.


Value

public Value(List<CoordinateInfo> v)
Create a AR_DATA_TYPE_COORDS value


Value

public Value(Object val,
             DataType dt)
Method Detail

getValue

public Object getValue()
Returns the underlying value as a generic Object. For example, the following code snippet illustrates how to return a Long or Integer value:
 Object value = value.getValue();

 DataType type = value.getDataType();

 switch(type)
 {
    case DataType.ULONG:
       Long longValue = (Long) value;

    case DataType.INTEGER:
       Integer intValue = (Integer) value;
 


getDataType

public DataType getDataType()
Returns the underlying Object's datatype DataType.


getIntValue

public int getIntValue()

getDoubleValue

public double getDoubleValue()

getCurrencyValue

public String getCurrencyValue()

toString

public String toString()
Returns a string description of the object.

Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Use this method for checking equality of Value. The result instanceof true only if the argument instanceof not null and instanceof a Value Object that represents the same dataType and content. Currently this function support the compare of the following data types: KEYWORD, INTEGER, REAL, CHAR, DIARY, TIME, ENUM, ULONG, BITMASK, DECIMAL, COORDS.

Overrides:
equals in class Object
Parameters:
obj - the object that we are comparing to
Returns:
returns a boolean that tells if the two objects equal

hashCode

public int hashCode()
Returns the hash code value for this instance of the current class. This method is supported as required by the general contract of Object.hashCode, for the benefit of hash tables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class Object
Returns:
returns the hash code for this instance

clone

public Object clone()
             throws CloneNotSupportedException
Clone implementation that returns an Object with data cloned from self.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

ConvertToARValue

public static Object ConvertToARValue(Object val)

getARValueType

public static int getARValueType(Object val)

convertFromARValue

public static Object convertFromARValue(Object[] arValue,
                                        boolean isStatusHistory,
                                        boolean preserveEnumTypeInfo)

AR System Java API

© Copyright 2006, 2007 BMC Software, Inc.