com.ibm.wala.util.tables
Class Table<T>

java.lang.Object
  extended by com.ibm.wala.util.tables.Table<T>
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
StringTable

public class Table<T>
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
protected  SimpleVector<java.lang.String> columnHeadings
           
protected  SimpleVector<SimpleVector<T>> rows
           
 
Constructor Summary
Table()
          create an empty table
Table(java.lang.String[] columns)
          create an empty table with the given column headings
Table(Table<T> t)
          create an empty table with the same column headings as t
 
Method Summary
 void addRow(java.util.Map<java.lang.String,T> p)
           
 java.lang.String getColumnHeading(int i)
          Note that column indices start at zero
 T getElement(int row, int column)
           
 int getNumberOfColumns()
           
 int getNumberOfRows()
           
 java.util.Map<java.lang.String,T> row2Map(int row)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rows

protected final SimpleVector<SimpleVector<T>> rows

columnHeadings

protected final SimpleVector<java.lang.String> columnHeadings
Constructor Detail

Table

public Table()
create an empty table


Table

public Table(Table<T> t)
create an empty table with the same column headings as t


Table

public Table(java.lang.String[] columns)
create an empty table with the given column headings

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getElement

public T getElement(int row,
                    int column)

getColumnHeading

public java.lang.String getColumnHeading(int i)
Note that column indices start at zero


getNumberOfColumns

public int getNumberOfColumns()

getNumberOfRows

public int getNumberOfRows()

row2Map

public java.util.Map<java.lang.String,T> row2Map(int row)

addRow

public void addRow(java.util.Map<java.lang.String,T> p)