System information

Appendix D. JAVA Example Code
D-22
read_only = false;
column_name = msg.read_string();
System.out.println("Reading column " + column_name);
alias = msg.read_string();
while(alias.length() > 0)
alias = msg.read_string();
processing = msg.read_string();
units = msg.read_string();
description = msg.read_string();
begin_index = msg.read_int();
piece_size = msg.read_int();
// we'll ignore the dimensions information and treat everything as
// a single dimensioned array. This greatly simplifies the math
// involved in generating array subscripts.
int dim = msg.read_int();
while(dim != 0)
dim = msg.read_int();
} // constructor
};
/** class TableDef
*
* Defines an object that holds the meta-information for a table. This
* information includes the table name as well as column information.
*/
protected static class TableDef
{
public int table_no;
public String table_name;
public int table_size;
public byte time_type;
public long interval;
public char def_sig;
public Vector columns;
TableDef(int table_no_, Packet msg) throws Exception
{
// read the table information
long interval_sec;
long interval_nsec;
int table_start_pos = msg.get_read_index();
table_no = table_no_;
table_name = msg.read_string();
table_size = msg.read_int();
time_type = msg.read_byte();
msg.move_past(8);
interval_sec = msg.read_int();
interval_nsec = msg.read_int();
interval = (interval_sec * nsecPerSec) + interval_nsec;
// we now need to read the columns until a terminator is found
byte field_type = msg.read_byte();
int column_no = 1;