JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.alsUtility
Class DataTable

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended bygov.nasa.alsUtility.DataTable
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class DataTable
extends java.util.Hashtable
implements java.io.Serializable

handles named Vectors of double data. Can save this data in tab separated ASCII files suitable for MS Excel and other data analysis packages.

See Also:
Serialized Form

Constructor Summary
DataTable()
           
 
Method Summary
 java.util.Vector getData(java.lang.String name)
          get the data associated with a name.
 void putDatum(java.lang.String name, double datum)
          adds datum to end of vector
 void putDatum(java.lang.String name, int place, double datum)
           
 void sort()
           
 void write(java.lang.String filename)
          write all the data to a tab separated ASCII file.
 void writeColumns(java.lang.String filename)
          write all the data to a tab separated ASCII file.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTable

public DataTable()
Method Detail

sort

public void sort()

putDatum

public void putDatum(java.lang.String name,
                     int place,
                     double datum)
Parameters:
name - name of the data to put a double into
place - index into the Vector to place the data
datum - the data to save

putDatum

public void putDatum(java.lang.String name,
                     double datum)
adds datum to end of vector


getData

public java.util.Vector getData(java.lang.String name)
get the data associated with a name. Create a new Vector if the data doesn't already exist.

Returns:
A Vector of data (possibly empty)

write

public void write(java.lang.String filename)
write all the data to a tab separated ASCII file. Place the names in the first column and all data associated with a name in the same row.


writeColumns

public void writeColumns(java.lang.String filename)
write all the data to a tab separated ASCII file. Place the names in the first row and all data associated with a name in the same column.


JavaGenes, NASA Ames. Written largely by Al Globus