CTL.CCompat
Class CArray<T>

java.lang.Object
  extended by CTL.CCompat.CArray<T>
All Implemented Interfaces:
Writable, TemplHack

public class CArray<T>
extends java.lang.Object
implements Writable, TemplHack

C++ array compatibility class


Field Summary
private  java.lang.Object[] arr
          Actual array
private  TypeTree type
          TypeTree for nested templated arrays
 
Constructor Summary
CArray()
          Simple constructor
CArray(int size)
          Constructor with known array size
 
Method Summary
 T get(int idx)
          Get one element's value
 void read(SerialIn in)
          Read from stream
 void read(SerialIn in, int len)
          Read from stream
 void set(int idx, T value)
          Set a new value for one element
 void setTypes(TypeTree[] types)
          Template hack
 java.lang.String toString()
          Conversion to string
 void write(SerialOut out)
          Write to stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

arr

private java.lang.Object[] arr
Actual array


type

private TypeTree type
TypeTree for nested templated arrays

Constructor Detail

CArray

public CArray()
Simple constructor


CArray

public CArray(int size)
Constructor with known array size

Method Detail

setTypes

public void setTypes(TypeTree[] types)
Template hack

Specified by:
setTypes in interface TemplHack
Parameters:
types - TypeTree

set

public void set(int idx,
                T value)
Set a new value for one element

Parameters:
idx - Index
value - Value

get

public T get(int idx)
Get one element's value

Parameters:
idx - Index
Returns:
Value

toString

public java.lang.String toString()
Conversion to string

Overrides:
toString in class java.lang.Object
Returns:
String

read

public void read(SerialIn in)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException,
                 java.lang.InstantiationException,
                 java.lang.IllegalAccessException,
                 java.lang.reflect.InvocationTargetException
Read from stream

Specified by:
read in interface Writable
Parameters:
in - Stream to read from
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

read

public void read(SerialIn in,
                 int len)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException,
                 java.lang.InstantiationException,
                 java.lang.IllegalAccessException,
                 java.lang.reflect.InvocationTargetException
Read from stream

Parameters:
in - Stream to read from
len - Length
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

write

public void write(SerialOut out)
           throws java.io.IOException,
                  java.lang.IllegalAccessException,
                  java.lang.reflect.InvocationTargetException,
                  CTLException
Write to stream

Specified by:
write in interface Writable
Parameters:
out - Stream to write to
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
CTLException