|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.collection.Map2D
A two-dimensional map whose rows and columns are indexed by arbitrary Java objects (like keys in a Java Map). Adding and removing rows are more efficient than adding and removing columns.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.2-1.0.0, Jun 23 2000, JL Created class - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Constructor Summary | |
Map2D()
Constructs a new 2D map. |
|
Map2D(Map2D old)
Constructs a new 2D map with the contents of the given map. |
Method Summary | |
boolean |
addCol(Object header)
Adds a column with the given header to the grid, or does nothing if the header already exists. |
boolean |
addRow(Object header)
Adds a row with the given header to the 2D map, or does nothing if the header already exists. |
Object |
clone()
|
boolean |
containsCol(Object header)
Returns whether there is a column with the given header. |
boolean |
containsRow(Object header)
Returns whether there is a row with the given header. |
boolean |
copyCol(Object fromHeader,
Object toHeader)
Shallow copies the data from one column to another. |
Object |
get(Object rowHeader,
Object colHeader)
Gets the data at the given row and column, or null if there is not any. |
Set |
getCols()
Returns a set of column headers. |
Set |
getRows()
Returns a set of row headers. |
static void |
main(String[] args)
Self-testing main |
Object |
matchCol(Map colData)
Returns the header of a column that matches the given collection of data, or null if there is no match. |
Object |
matchRow(Map rowData)
Returns the header of a row that matches the given collection of data, or null if there is no match. |
void |
put(Object rowHeader,
Object colHeader,
Object data)
Puts the data at the given row and column. |
boolean |
removeCol(Object header)
Removes the column with the given header, if it exists. |
boolean |
removeRow(Object header)
Removes the row with the given header, if it exists. |
boolean |
renameCol(Object oldHeader,
Object newHeader)
Renames the column with the given header to the given new name. |
boolean |
renameRow(Object oldHeader,
Object newHeader)
Renames the row with the given header to the given new name, if it exists. |
String |
toString()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Map2D()
public Map2D(Map2D old)
Method Detail |
public boolean addRow(Object header)
public boolean containsRow(Object header)
public boolean removeRow(Object header)
public boolean renameRow(Object oldHeader, Object newHeader)
public boolean addCol(Object header)
public boolean containsCol(Object header)
public boolean removeCol(Object header)
public boolean renameCol(Object oldHeader, Object newHeader)
public boolean copyCol(Object fromHeader, Object toHeader)
public void put(Object rowHeader, Object colHeader, Object data)
public Object get(Object rowHeader, Object colHeader)
public Set getRows()
public Set getCols()
public Object matchRow(Map rowData)
public Object matchCol(Map colData)
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
public static void main(String[] args)
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |