Package 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 Object
-
-
Field Summary
Fields Modifier and Type Field Description protected SimpleVector<String>
columnHeadings
protected ArrayList<SimpleVector<T>>
rows
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRow(Map<String,T> p)
int[]
computeColumnWidths()
String
getColumnHeading(int i)
Note that column indices start at zeroT
getElement(int row, int column)
int
getNumberOfColumns()
int
getNumberOfRows()
static void
padWithSpaces(StringBuffer b, int length)
void
removeRow(Map<String,T> p)
Map<String,T>
row2Map(int row)
String
toString()
-
-
-
Field Detail
-
rows
protected final ArrayList<SimpleVector<T>> rows
-
columnHeadings
protected final SimpleVector<String> columnHeadings
-
-
Constructor Detail
-
Table
public Table()
create an empty table
-
Table
public Table(Table<T> t) throws IllegalArgumentException
create an empty table with the same column headings as t- Throws:
IllegalArgumentException
- if t == null
-
Table
public Table(String[] columns) throws IllegalArgumentException
create an empty table with the given column headings- Throws:
IllegalArgumentException
- if columns == null, or columns[i] == null for some i
-
-
Method Detail
-
getElement
public T getElement(int row, int column)
-
getColumnHeading
public String getColumnHeading(int i)
Note that column indices start at zero
-
computeColumnWidths
public int[] computeColumnWidths()
-
getNumberOfColumns
public int getNumberOfColumns()
-
getNumberOfRows
public int getNumberOfRows()
-
padWithSpaces
public static void padWithSpaces(StringBuffer b, int length)
-
-