|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjwo.landserf.structure.AttributeTable
Represents a set of attributes that can be associated with a spatial model. The table must consist of a unique primary key that corresponds to the spatial object's primary attribute, and a set of one or more secondary attributes. These attributes can be numeric or textual.
Constructor Summary | |
AttributeTable(AttributeTable oldTable)
Creates a new clone of the given attribute table. |
|
AttributeTable(int numCols)
Creates an attribute table with the given number of columns. |
|
AttributeTable(int numCols,
String[] headings)
Creates an attribute table with the given number of columns and given column headings. |
Method Summary | |
void |
addAttributes(float id,
Object[] attributes)
Adds a given set of attributes associated with the given attribute ID to the table. |
void |
addColumn()
Adds a column with default name to the table. |
void |
addColumn(String columnName)
Adds a column with the given name to the table. |
void |
addRow()
Adds a blank row to the attribute table. |
int |
getActiveColumn()
Reports the currently selected active column used for retrieving attributes, or -1 if table is empty. |
Object |
getAttribute(float id)
Retrieves the attribute associated with the given ID. |
Object[] |
getAttributes(float id)
Retrieves all the attributes associated with the given ID. |
Class |
getColumnClass(int column)
Reports the type of object stored in the given column. |
int |
getColumnCount()
Reports the number of columns in the table. |
String |
getColumnName(int col)
Reports the given column heading. |
String |
getFormattedAttribute(float id)
Retrieves a formatted version of the attribute associated with the given ID. |
float |
getNumericAttribute(float id)
Retrieves a numeric attribute associated with the given ID. |
int |
getRowCount()
Reports the number of rows in the table. |
AbstractTableModel |
getTableModel()
Reports the table model used to store the attribute values. |
Object |
getValueAt(int row,
int col)
Reports the value stored in the table at the given coordinates. |
boolean |
isCellEditable(int row,
int col)
Reports whether the cell represented by the given coordinates is editable. |
boolean |
isNumeric()
Reports whether the current active column contains numeric values. |
boolean |
isNumeric(int col)
Reports whether the given colum contains numeric values. |
void |
setActiveColumn(int activeCol)
Sets the column to use for retrieving attributes. |
void |
setAttribute(float id,
int column,
Object newValue)
Sets the attribute associated with the given ID and column value. |
void |
setColumnName(int col,
String name)
Sets the name of the given column. |
void |
setHeadings(String[] headings)
Sets the headings associated with the table columns. |
void |
setValueAt(Object value,
int row,
int col)
Sets the value stored in the table at the given coordinates. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AttributeTable(AttributeTable oldTable)
oldTable
- Table to clone.public AttributeTable(int numCols)
numCols
- Number of columns (equal to 1 + number of attibutes).public AttributeTable(int numCols, String[] headings)
numCols
- Number of columns (equal to 1 + number of attibutes).headings
- Array of column headings, or null if none provided.Method Detail |
public void setHeadings(String[] headings)
headings
- List of column headings.public void setActiveColumn(int activeCol)
activeCol
- The column to use for retrieving attributes.public AbstractTableModel getTableModel()
public int getActiveColumn()
public Object getAttribute(float id)
id
- ID to search for.
public String getFormattedAttribute(float id)
id
- ID to search for.
public void setAttribute(float id, int column, Object newValue)
id
- ID to search for.column
- Column representing attribute to change (0 = ID).newValue
- New value to place in table.public Object[] getAttributes(float id)
id
- ID to search for.
public float getNumericAttribute(float id)
id
- ID to search for.
public void addAttributes(float id, Object[] attributes)
id
- ID associated with the attributes.attributes
- Array of attributes. Should be equal in size to the number
of columns-1 defined when creating the attribute table.public void addRow()
public void addColumn()
public void addColumn(String columnName)
columnName
- Name of column to add.public boolean isNumeric()
public boolean isNumeric(int col)
col
- Column to query.
public void setColumnName(int col, String name)
col
- Number of the column to change (first is column 0).name
- New name for the given column.public String getColumnName(int col)
col
- Column number to query.
public int getRowCount()
public int getColumnCount()
public Object getValueAt(int row, int col)
row
- Row coordinate to query.col
- Column coordinate to query.
public boolean isCellEditable(int row, int col)
row
- Row coordinate to query.col
- Column coordinate to query.
public Class getColumnClass(int column)
column
- Column to query.
public void setValueAt(Object value, int row, int col)
value
- Value to store in table.row
- Row coordinate of cell to set.col
- Column coordinate of cell to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |