com.tivoli.twg.libs
Class TWGLong

java.lang.Object
  extended bycom.tivoli.twg.libs.TWGLong
All Implemented Interfaces:
DataValue, java.io.Serializable

public class TWGLong
extends java.lang.Object
implements DataValue, java.io.Serializable

Sendable long integer object, based on DataValue interface. These are intended for use when data needs to be communicated to and from both Java and non-Java code.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.tivoli.twg.libs.DataValue
BOOLEAN_ARRAY_TYPE, BOOLEAN_TYPE, BYTE_ARRAY_TYPE, BYTE_TYPE, DATE_TYPE, DOUBLE_ARRAY_TYPE, DOUBLE_TYPE, FLOAT_ARRAY_TYPE, FLOAT_TYPE, FORMATTED_STRING_TYPE, INTEGER_ARRAY_TYPE, INTEGER_TYPE, LOCALESPECSTRING_TYPE, LONG_ARRAY_TYPE, LONG_TYPE, NLSSTRING_TYPE, NONE_TYPE, SHORT_ARRAY_TYPE, SHORT_TYPE, STRING_ARRAY_TYPE, STRING_TYPE
 
Constructor Summary
TWGLong()
          Default constructor
TWGLong(long v)
          Construct with initial value
 
Method Summary
 int getDataValueType()
          Get DataValue type
 long getValue()
          Get current value
 int readDataValue(byte[] buf, int start)
          Read value from byte array into object
 void setValue(long v)
          Set new value
 java.lang.String toNLSString(java.util.Locale loc)
          Get NLS value as string
 java.lang.String toString()
          Get value as string
 int writeDataValue(byte[] buf, int start)
          Write value into byte array : used for sending data value
 int writeDataValueLength()
          Get length needed to write value into byte array : used for sending data value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGLong

public TWGLong()
Default constructor


TWGLong

public TWGLong(long v)
Construct with initial value

Parameters:
v - - initial value
Method Detail

toString

public java.lang.String toString()
Get value as string


toNLSString

public java.lang.String toNLSString(java.util.Locale loc)
Get NLS value as string

Specified by:
toNLSString in interface DataValue
Parameters:
loc - - locale

setValue

public void setValue(long v)
Set new value

Parameters:
v - - new value

getValue

public long getValue()
Get current value

Returns:
current value

writeDataValue

public int writeDataValue(byte[] buf,
                          int start)
Write value into byte array : used for sending data value

Specified by:
writeDataValue in interface DataValue
Parameters:
buf - - buffer to write data into
start - - starting index for data write in 'buf'
Returns:
index of byte after last byte writted to 'buf'

writeDataValueLength

public int writeDataValueLength()
Get length needed to write value into byte array : used for sending data value

Specified by:
writeDataValueLength in interface DataValue
Returns:
bytes needed

readDataValue

public int readDataValue(byte[] buf,
                         int start)
Read value from byte array into object

Specified by:
readDataValue in interface DataValue
Parameters:
buf - - buffer to read from
start - - index of start of data to be read
Returns:
index of byte after last byte read

getDataValueType

public int getDataValueType()
Get DataValue type

Specified by:
getDataValueType in interface DataValue
Returns:
type code for DataValue subclass