com.tivoli.twg.libs
Class TWGShortArray

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

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

Sendable short integer array 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
static long serialVersionUID
           
 
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
TWGShortArray()
          Default constructor : null string
TWGShortArray(short[] v)
          Construct with initial value
TWGShortArray(short[] v, int start, int l)
          Construct with initial value
 
Method Summary
 void appendValue(short newval)
          Append new value at end of array
 int getDataValueType()
          Get DataValue type
 int getLength()
          Get length of array
 short[] getValue()
          Get copy of value array
 short getValueAt(int index)
          Get new value at given index of array
 int readDataValue(byte[] buf, int start)
          Read value from byte array into object
 void removeValueAt(int index)
          Remove value at given index of array
 void setLength(int newlen)
          Set length of array
 void setValue(short[] v)
          Set new value
 void setValue(short[] v, int start, int l)
          Set new value
 void setValueAt(int index, short newval)
          Set new value at given index of array
 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
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

TWGShortArray

public TWGShortArray()
Default constructor : null string


TWGShortArray

public TWGShortArray(short[] v,
                     int start,
                     int l)
Construct with initial value

Parameters:
v - - initial value array
start - - starting index of value
l - - length of value array

TWGShortArray

public TWGShortArray(short[] 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

getValue

public short[] getValue()
Get copy of value array

Returns:
value of array

setValue

public void setValue(short[] v)
Set new value

Parameters:
v - - new value array

setValue

public void setValue(short[] v,
                     int start,
                     int l)
Set new value

Parameters:
v - - new value array
start - - start index of value set

getValueAt

public short getValueAt(int index)
Get new value at given index of array

Parameters:
index - - index to be read

removeValueAt

public void removeValueAt(int index)
Remove value at given index of array

Parameters:
index - - index to be removed

setValueAt

public void setValueAt(int index,
                       short newval)
Set new value at given index of array

Parameters:
index - - index to be written
newval - - value to be written

appendValue

public void appendValue(short newval)
Append new value at end of array

Parameters:
newval - - value to be written

getLength

public int getLength()
Get length of array

Returns:
array length

setLength

public void setLength(int newlen)
Set length of array

Parameters:
newlen - - new length

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