gov.sns.ca
Class ChannelRecord

java.lang.Object
  |
  +--gov.sns.ca.ChannelRecord
Direct Known Subclasses:
ChannelStatusRecord

public class ChannelRecord
extends java.lang.Object

ChannelRecord is a wrapper for the value returned by a get operation on a Channel. It a provides convenience methods for getting data back as one of many primitive types.


Field Summary
protected  ArrayValue store
           
 
Constructor Summary
ChannelRecord(ValueAdaptor adaptor)
          Creates new ChannelRecord
 
Method Summary
 byte[] byteArray()
          Get the data converted to a byte array.
 byte byteValue()
          Get the data converted to a scalar byte.
 byte byteValueAt(int index)
          Get the value of the array element identified by the index and convert it to a byte.
 double[] doubleArray()
          Get the data converted to a double array.
 double doubleValue()
          Get the data converted to a scalar double.
 double doubleValueAt(int index)
          Get the value of the array element identified by the index and convert it to a double.
 float[] floatArray()
          Get the data converted to a float array.
 float floatValue()
          Get the data converted to a scalar float.
 float floatValueAt(int index)
          Get the value of the array element identified by the index and convert it to a float.
 int getCount()
          Get the number of elements in the array value.
 java.lang.Class getType()
          Get the native type of the data as a Java class.
 int[] intArray()
          Get the data converted to a int array.
 int intValue()
          Get the data converted to a scalar int.
 int intValueAt(int index)
          Get the value of the array element identified by the index and convert it to a int.
 short[] shortArray()
          Get the data converted to a short array.
 short shortValue()
          Get the data converted to a scalar short.
 short shortValueAt(int index)
          Get the value of the array element identified by the index and convert it to a short.
 java.lang.String[] stringArray()
          Get the data converted to a string array.
 java.lang.String stringValue()
          Get the data converted to a scalar string.
 java.lang.String stringValueAt(int index)
          Get the value of the array element identified by the index and convert it to a string.
 java.lang.String toString()
          Override toString to return a representation of the data as an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

store

protected ArrayValue store
Constructor Detail

ChannelRecord

public ChannelRecord(ValueAdaptor adaptor)
Creates new ChannelRecord

Method Detail

getCount

public int getCount()
Get the number of elements in the array value.

Returns:
The length of the array.

getType

public java.lang.Class getType()
Get the native type of the data as a Java class.

Returns:
The native type of the data.

byteValue

public byte byteValue()
Get the data converted to a scalar byte. If the data is an array the the value of the first element is converted to a byte and returned.

Returns:
The data as a scalar byte.

byteValueAt

public byte byteValueAt(int index)
Get the value of the array element identified by the index and convert it to a byte.

Parameters:
index - The index of the array element to get.
Returns:
The data element at the index as a scalar byte.

byteArray

public byte[] byteArray()
Get the data converted to a byte array.

Returns:
The data as a byte array.

shortValue

public short shortValue()
Get the data converted to a scalar short. If the data is an array the the value of the first element is converted to a short and returned.

Returns:
The data as a scalar short.

shortValueAt

public short shortValueAt(int index)
Get the value of the array element identified by the index and convert it to a short.

Parameters:
index - The index of the array element to get.
Returns:
The data element at the index as a scalar short.

shortArray

public short[] shortArray()
Get the data converted to a short array.

Returns:
The data as a short array.

intValue

public int intValue()
Get the data converted to a scalar int. If the data is an array the the value of the first element is converted to a int and returned.

Returns:
The data as a scalar int.

intValueAt

public int intValueAt(int index)
Get the value of the array element identified by the index and convert it to a int.

Parameters:
index - The index of the array element to get.
Returns:
The data element at the index as a scalar int.

intArray

public int[] intArray()
Get the data converted to a int array.

Returns:
The data as a int array.

floatValue

public float floatValue()
Get the data converted to a scalar float. If the data is an array the the value of the first element is converted to a float and returned.

Returns:
The data as a scalar float.

floatValueAt

public float floatValueAt(int index)
Get the value of the array element identified by the index and convert it to a float.

Parameters:
index - The index of the array element to get.
Returns:
The data element at the index as a scalar float.

floatArray

public float[] floatArray()
Get the data converted to a float array.

Returns:
The data as a float array.

doubleValue

public double doubleValue()
Get the data converted to a scalar double. If the data is an array the the value of the first element is converted to a double and returned.

Returns:
The data as a scalar double.

doubleValueAt

public double doubleValueAt(int index)
Get the value of the array element identified by the index and convert it to a double.

Parameters:
index - The index of the array element to get.
Returns:
The data element at the index as a scalar double.

doubleArray

public double[] doubleArray()
Get the data converted to a double array.

Returns:
The data as a double array.

stringValue

public java.lang.String stringValue()
Get the data converted to a scalar string. If the data is an array the the value of the first element is converted to a string and returned.

Returns:
The data as a scalar string.

stringValueAt

public java.lang.String stringValueAt(int index)
Get the value of the array element identified by the index and convert it to a string.

Parameters:
index - The index of the array element to get.
Returns:
The data element at the index as a scalar string.

stringArray

public java.lang.String[] stringArray()
Get the data converted to a string array.

Returns:
The data as a string array.

toString

public java.lang.String toString()
Override toString to return a representation of the data as an array.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.