@Deprecated
public class AttributeTable
extends java.lang.Object
Constructor and Description |
---|
AttributeTable(int numRows,
int numCols,
processing.core.PApplet parent)
Deprecated.
Creates a new empty table with the given dimensions
|
AttributeTable(processing.core.PApplet parent)
Deprecated.
Creates a new empty 10 by 10 table.
|
AttributeTable(java.lang.String filename,
processing.core.PApplet parent)
Deprecated.
Creates a table from the given tab separated values file.
|
Modifier and Type | Method and Description |
---|---|
static processing.data.Table |
buildNewTable(AttributeTable oldTable)
Deprecated.
Builds a Table from the given (deprecated) attribute table.
|
static AttributeTable |
buildOldTable(processing.data.Table table,
processing.core.PApplet parent)
Deprecated.
Builds an old AttributeTable from the given Table.
|
int[] |
calcMaxWidths()
Deprecated.
Calculates the maximum widths of the values in each column.
|
int |
findNumCols()
Deprecated.
Finds the number of columns in the table.
|
float |
getFloat(int id,
int columnIndex)
Deprecated.
Reports the item in the row with the given ID at the given column location as a decimal number.
|
float |
getFloat(java.lang.String id,
int columnIndex)
Deprecated.
Reports the item in the row with the given ID at the given column location as a decimal number.
|
float |
getFloatAt(int rowIndex,
int columnIndex)
Deprecated.
Reports the item at the given row and column location as a decimal number.
|
java.lang.String[] |
getHeadings()
Deprecated.
Reports the column headings for the table.
|
int |
getInt(int id,
int columnIndex)
Deprecated.
Reports the item in the row with the given ID at the given column location as a whole number.
|
int |
getInt(java.lang.String id,
int columnIndex)
Deprecated.
Reports the item in the row with the given ID at the given column location as a whole number.
|
int |
getIntAt(int rowIndex,
int columnIndex)
Deprecated.
Reports the item at the given row and column location as a whole number.
|
int |
getRowCount()
Deprecated.
Reports the number of rows in the table.
|
int |
getRowIndex(int id)
Deprecated.
Finds a row by its ID.
|
int |
getRowIndex(java.lang.String id)
Deprecated.
Finds a row by its ID.
|
java.lang.String |
getRowName(int rowIndex)
Deprecated.
Reports the id of the row at the given row index (first row is 0, second is 1 etc.).
|
java.lang.String |
getString(int id,
int columnIndex)
Deprecated.
Reports the item in the row with the given ID at the given column location as a String.
|
java.lang.String |
getString(java.lang.String id,
int columnIndex)
Deprecated.
Reports the item in the given column position with the given ID as a String.
|
java.lang.String |
getStringAt(int rowIndex,
int columnIndex)
Deprecated.
Reports the item at the given row and column location as a String.
|
java.util.Set<java.lang.Integer> |
match(java.lang.String attribute,
int columnIndex)
Deprecated.
Reports the ids of all items at the given column index that match the given text
|
void |
setFloat(int id,
int columnIndex,
float value)
Deprecated.
Sets the value at the given row and column as the given decimal number.
|
void |
setFloat(java.lang.String id,
int columnIndex,
float value)
Deprecated.
Sets the value at the given row and column as the given decimal number.
|
void |
setFloatAt(int rowIndex,
int columnIndex,
float value)
Deprecated.
Sets the value at the given row and column location as the given decimal number.
|
void |
setHeadings(java.lang.String[] headings)
Deprecated.
Sets the column headings for the table.
|
void |
setInt(int id,
int columnIndex,
int value)
Deprecated.
Sets the value at the given row and column as the given whole number.
|
void |
setInt(java.lang.String id,
int columnIndex,
int value)
Deprecated.
Sets the value at the given row and column as the given whole number.
|
void |
setIntAt(int rowIndex,
int columnIndex,
int value)
Deprecated.
Sets the value at the given row and column location as the given whole number.
|
void |
setRowName(int rowIndex,
java.lang.String id)
Deprecated.
Sets the ID of the given row.
|
void |
setString(int id,
int columnIndex,
java.lang.String value)
Deprecated.
Sets the value at the given row and column as the given String.
|
void |
setString(java.lang.String id,
int columnIndex,
java.lang.String value)
Deprecated.
Sets the value at the given row and column as the given String.
|
void |
setStringAt(int rowIndex,
int columnIndex,
java.lang.String value)
Deprecated.
Sets the value at the given row and column location as the given String.
|
void |
write()
Deprecated.
Writes this table in TSV format to standard output.
|
void |
write(java.io.PrintWriter writer)
Deprecated.
Writes this table as a TSV file to the given writer.
|
void |
write(java.lang.String fileName)
Deprecated.
Writes this table as a TSV file with the given name.
|
void |
writeAsTable(int maxNumRows)
Deprecated.
Writes this table as formatted text to standard output.
|
void |
writeAsTable(java.io.PrintWriter writer,
int maxNumRows)
Deprecated.
Writes this table as formatted text to the given writer.
|
void |
writeAsTable(java.lang.String fileName,
int maxNumRows)
Deprecated.
Writes this table as formatted text to the file with the given name.
|
public AttributeTable(processing.core.PApplet parent)
parent
- Sketch controlling the location of files to load and save.public AttributeTable(int numRows, int numCols, processing.core.PApplet parent)
numRows
- Number of rows in table.numCols
- Number of columns in table.parent
- Sketch controlling the location of files to load and save.public AttributeTable(java.lang.String filename, processing.core.PApplet parent)
filename
- Name of file containing the TSVs.parent
- Parent sketch from which file reading is handled.public void setHeadings(java.lang.String[] headings)
headings
- Text headings for each column in the table.public java.lang.String[] getHeadings()
public int getRowCount()
public int getRowIndex(java.lang.String id)
id
- ID of the row to search for.public int getRowIndex(int id)
id
- ID of the row to search for.public java.lang.String getRowName(int rowIndex)
rowIndex
- Row index to query.public java.lang.String getStringAt(int rowIndex, int columnIndex)
rowIndex
- Row index of the table value to retrieve (first row is 0, second is 1 etc.).columnIndex
- Column index of the table value to retrieve. (first column is 0, second is 1 etc.).public java.util.Set<java.lang.Integer> match(java.lang.String attribute, int columnIndex)
attribute
- Text to search for.columnIndex
- Column in table to search (first column is 0, second is 1 etc.).public java.lang.String getString(java.lang.String id, int columnIndex)
id
- ID of the row to query.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public java.lang.String getString(int id, int columnIndex)
id
- ID of the row to query.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public int getIntAt(int rowIndex, int columnIndex)
rowIndex
- Row of the table value to retrieve.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public int getInt(java.lang.String id, int columnIndex)
id
- ID of the row to query.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public int getInt(int id, int columnIndex)
id
- ID of the row to query.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public float getFloatAt(int rowIndex, int columnIndex)
rowIndex
- Row of the table value to retrieve.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public float getFloat(java.lang.String id, int columnIndex)
id
- ID of the row to query.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public float getFloat(int id, int columnIndex)
id
- ID of the row to query.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc).public void setRowName(int rowIndex, java.lang.String id)
rowIndex
- Row in which to set the name (0 is the first row, 1 the second etc.).id
- New ID (column 0 value) to be associated with the given row.public void setStringAt(int rowIndex, int columnIndex, java.lang.String value)
rowIndex
- Row of the table value to change (0 is the first row, 1 is the second etc.).columnIndex
- Column of the table value to change (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setString(int id, int columnIndex, java.lang.String value)
id
- ID of the row in which a value will be changed.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setString(java.lang.String id, int columnIndex, java.lang.String value)
id
- ID of the row in which a value will be changed.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setIntAt(int rowIndex, int columnIndex, int value)
rowIndex
- Row of the table value to change (0 is the first row, 1 is the second etc.).columnIndex
- Column of the table value to change (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setInt(java.lang.String id, int columnIndex, int value)
id
- ID of the row in which a value will be changed.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setInt(int id, int columnIndex, int value)
id
- ID of the row in which a value will be changed.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setFloatAt(int rowIndex, int columnIndex, float value)
rowIndex
- Row of the table value to change (0 is the first row, 1 is the second etc.).columnIndex
- Column of the table value to change (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setFloat(java.lang.String id, int columnIndex, float value)
id
- ID of the row in which a value will be changed.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public void setFloat(int id, int columnIndex, float value)
id
- ID of the row in which a value will be changed.columnIndex
- Column of the table value to retrieve (0 is the first column, 1 is the second etc.).value
- New value to be associated with the given table cell.public int[] calcMaxWidths()
public int findNumCols()
public void write()
public void write(java.lang.String fileName)
fileName
- Name of file to contain the TSV output.public void write(java.io.PrintWriter writer)
writer
- Output writer in which to send table contents.public void writeAsTable(int maxNumRows)
maxNumRows
- Maximum number of rows of the table to display.public void writeAsTable(java.lang.String fileName, int maxNumRows)
fileName
- Name of file to contain the formatted output.maxNumRows
- Maximum number of rows of the table to display.public void writeAsTable(java.io.PrintWriter writer, int maxNumRows)
writer
- Output writer in which to send table contents.maxNumRows
- Maximum number of rows of the table to display.public static AttributeTable buildOldTable(processing.data.Table table, processing.core.PApplet parent)
table
- Table to convert.parent
- Parent sketch that deals with file handling should the attribute table need saving.public static processing.data.Table buildNewTable(AttributeTable oldTable)
oldTable
- Old table to convert.