com.ibm.wala.util.tables
Class Table<T>
java.lang.Object
com.ibm.wala.util.tables.Table<T>
- Direct Known Subclasses:
- StringTable
public class Table<T>
- extends java.lang.Object
|
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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
rows
protected final java.util.ArrayList<SimpleVector<T>> rows
columnHeadings
protected final SimpleVector<java.lang.String> columnHeadings
Table
public Table()
- create an empty table
Table
public Table(Table<T> t)
throws java.lang.IllegalArgumentException
- create an empty table with the same column headings as t
- Throws:
java.lang.IllegalArgumentException - if t == null
Table
public Table(java.lang.String[] columns)
throws java.lang.IllegalArgumentException
- create an empty table with the given column headings
- Throws:
java.lang.IllegalArgumentException - if columns == null, or columns[i] == null for some i
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
computeColumnWidths
public int[] computeColumnWidths()
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)
removeRow
public void removeRow(java.util.Map<java.lang.String,T> p)
padWithSpaces
public static void padWithSpaces(java.lang.StringBuffer b,
int length)