|
SandMark version 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sandmark.util.LabeledGrid
A sandmark.util.LabeledGrid object provides a general-purpose fixed-size two-dimensional array with row and column labels. Values and labels can be objects of any type. Shortcut methods are provided for loading and storing primitive integer and floating types.
Constructor Summary | |
LabeledGrid(int ncols,
int nrows)
Constructs a LabeledGrid of specified size. |
|
LabeledGrid(java.lang.Object[] collabels,
java.lang.Object[] rowlabels)
Constructs a LabeledGrid given two sets of labels. |
Method Summary | |
java.lang.Object[] |
getColumn(int i)
Gets the values of an entire column. |
java.lang.Object |
getColumnLabel(int i)
Returns the label of one column. |
java.lang.Object[] |
getColumnLabels()
Returns a list of the column labels. |
double |
getDouble(int col,
int row)
Gets a grid value as a double. |
float |
getFloat(int col,
int row)
Gets a grid value as a float. |
int |
getInt(int col,
int row)
Gets a grid value as an int. |
long |
getLong(int col,
int row)
Gets a grid value as a long. |
java.lang.Object[] |
getRow(int j)
Gets the values of an entire row. |
java.lang.Object |
getRowLabel(int i)
Returns the label of one row. |
java.lang.Object[] |
getRowLabels()
Returns a list of the row labels. |
java.lang.String |
getString(int col,
int row)
Gets a grid value as a String. |
java.lang.Object |
getValue(int col,
int row)
Gets a value from the grid. |
static void |
main(java.lang.String[] args)
|
void |
print(java.io.PrintStream p)
Prints the contents of this grid. |
void |
setColumn(int i,
java.lang.Object[] values)
Sets all the values in a column. |
void |
setColumnLabel(int i,
java.lang.Object o)
Sets the label of one column. |
void |
setColumnLabels(java.lang.Object[] labels)
Replaces the column labels. |
void |
setRow(int j,
java.lang.Object[] values)
Sets all the values in a row. |
void |
setRowLabel(int i,
java.lang.Object o)
Sets the label of one row. |
void |
setRowLabels(java.lang.Object[] labels)
Replaces the row labels. |
void |
setValue(int col,
int row,
double value)
Sets a value in the grid to a Double value. |
void |
setValue(int col,
int row,
long value)
Sets a value in the grid to a Long value. |
void |
setValue(int col,
int row,
java.lang.Object value)
Sets a value in the grid. |
java.lang.String |
toString()
Returns a String representation of this LabeledGrid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LabeledGrid(int ncols, int nrows)
public LabeledGrid(java.lang.Object[] collabels, java.lang.Object[] rowlabels)
Method Detail |
public java.lang.Object getValue(int col, int row)
public int getInt(int col, int row)
public long getLong(int col, int row)
public float getFloat(int col, int row)
public double getDouble(int col, int row)
public java.lang.String getString(int col, int row)
public void setValue(int col, int row, java.lang.Object value)
public void setValue(int col, int row, long value)
public void setValue(int col, int row, double value)
public java.lang.Object[] getColumn(int i)
public void setColumn(int i, java.lang.Object[] values)
public java.lang.Object[] getRow(int j)
public void setRow(int j, java.lang.Object[] values)
public java.lang.Object[] getColumnLabels()
public void setColumnLabels(java.lang.Object[] labels)
public java.lang.Object getColumnLabel(int i)
public void setColumnLabel(int i, java.lang.Object o)
public java.lang.Object[] getRowLabels()
public void setRowLabels(java.lang.Object[] labels)
public java.lang.Object getRowLabel(int i)
public void setRowLabel(int i, java.lang.Object o)
public void print(java.io.PrintStream p)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
SandMark version 3.0 Wed Jan 29 10:30:05 MST 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |