Class VOSingleTable

java.lang.Object
  |
  +--VOSingleTable

public class VOSingleTable
extends java.lang.Object

This class takes a VOTableUtil.Table object and reads in all the data into memory efficient blocks. The data is then ready to hand back in whatever form the user likes.


Constructor Summary
VOSingleTable(Table table, java.io.PrintWriter out)
          The main method is this constructor.
 
Method Summary
 byte[] getBitArray(int ifield, int irecord)
          Creates and returns an array of unsigned bytes for the given table cell.
 byte[] getByteArray(int ifield, int irecord)
          Creates and returns an array of unsigned bytes for the given table cell.
 char[] getCharArray(int ifield, int irecord)
          Creates and returns an array of characters for the given table cell.
 double[] getDoubleArray(int ifield, int irecord)
          Creates and returns an array of double for the given table cell.
 double[] getDoubleComplexArray(int ifield, int irecord)
          Creates and returns an array of double complex for the given table cell.
 int getFieldCount()
          Number of fields (columns) in the table.
 float[] getFloatArray(int ifield, int irecord)
          Creates and returns an array of double for the given table cell.
 float[] getFloatComplexArray(int ifield, int irecord)
          Creates and returns an array of float complex for the given table cell.
 int[] getIntArray(int ifield, int irecord)
          Creates and returns an array of 32-bit int for the given table cell.
 java.lang.String getLastError()
          If there is an error in reading in the table, this is where to get it.
 boolean[] getLogicalArray(int ifield, int irecord)
          Creates and returns an array of boolean for the given table cell.
 long[] getLongArray(int ifield, int irecord)
          Creates and returns an array of 64-bit long for the given table cell.
 int getRecordCount()
          Number of records (rows) in the table.
 short[] getShortArray(int ifield, int irecord)
          Creates and returns an array of 16-bit short for the given table cell.
 java.lang.String getString(int ifield, int irecord)
          A String representation of the table cell.
 java.lang.String[] getStringArray(int ifield, int irecord)
          Creates and returns an array of Strings for the givern table cell, each of which is the result of calling the toString() method of the Primitive datatype.
 Table getTable()
          Convenience so you can get the Table back again that was used in the construction.
 char[] getUnicodeCharArray(int ifield, int irecord)
          Creates and returns an array of Unicode characters for the given table cell.
 boolean isVariableLength(int ifield)
          Tells you if a given field is variable length (different size array for each cell in the colunm), otherwise fixed length (each cell of the column is the same length).
 int primitiveCount(int ifield, int irecord)
          Number of primitives in a given table cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VOSingleTable

public VOSingleTable(Table table,
                     java.io.PrintWriter out)
The main method is this constructor. It parses the text in the TR and TD and STREAM elements to actually get the table into memory, and ready to use for computation. WARNING: Binary and Fits NOT YET IMPLEMENTED
Method Detail

getLastError

public java.lang.String getLastError()
If there is an error in reading in the table, this is where to get it. The caller should ALWAYS check that this method is returning null. If it is not null then print it out because that is what went wrong.

getTable

public Table getTable()
Convenience so you can get the Table back again that was used in the construction.

getRecordCount

public int getRecordCount()
Number of records (rows) in the table.

getFieldCount

public int getFieldCount()
Number of fields (columns) in the table. Should be the same as Table.getFieldCount().

isVariableLength

public boolean isVariableLength(int ifield)
Tells you if a given field is variable length (different size array for each cell in the colunm), otherwise fixed length (each cell of the column is the same length).

primitiveCount

public int primitiveCount(int ifield,
                          int irecord)
Number of primitives in a given table cell. If not variableLength, this is the same for all records, and the irecord argument is ignored.

getString

public java.lang.String getString(int ifield,
                                  int irecord)
A String representation of the table cell. Each primitive has its toString() method called, and the results concatenated with spaces between. Except for characacter data, which is not space separated.

getStringArray

public java.lang.String[] getStringArray(int ifield,
                                         int irecord)
Creates and returns an array of Strings for the givern table cell, each of which is the result of calling the toString() method of the Primitive datatype.

getByteArray

public byte[] getByteArray(int ifield,
                           int irecord)
Creates and returns an array of unsigned bytes for the given table cell.

getBitArray

public byte[] getBitArray(int ifield,
                          int irecord)
Creates and returns an array of unsigned bytes for the given table cell. Each byte is eight of the bits, with the last byte perhaps unfilled.

getLogicalArray

public boolean[] getLogicalArray(int ifield,
                                 int irecord)
Creates and returns an array of boolean for the given table cell.

getCharArray

public char[] getCharArray(int ifield,
                           int irecord)
Creates and returns an array of characters for the given table cell.

getUnicodeCharArray

public char[] getUnicodeCharArray(int ifield,
                                  int irecord)
Creates and returns an array of Unicode characters for the given table cell. WARNING: This code untested

getDoubleArray

public double[] getDoubleArray(int ifield,
                               int irecord)
Creates and returns an array of double for the given table cell.

getDoubleComplexArray

public double[] getDoubleComplexArray(int ifield,
                                      int irecord)
Creates and returns an array of double complex for the given table cell.

getFloatArray

public float[] getFloatArray(int ifield,
                             int irecord)
Creates and returns an array of double for the given table cell.

getFloatComplexArray

public float[] getFloatComplexArray(int ifield,
                                    int irecord)
Creates and returns an array of float complex for the given table cell.

getIntArray

public int[] getIntArray(int ifield,
                         int irecord)
Creates and returns an array of 32-bit int for the given table cell.

getLongArray

public long[] getLongArray(int ifield,
                           int irecord)
Creates and returns an array of 64-bit long for the given table cell.

getShortArray

public short[] getShortArray(int ifield,
                             int irecord)
Creates and returns an array of 16-bit short for the given table cell.