|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.util.Cells
public class Cells
Represents a simple 2-dim. Matrix. Useful for Spreadsheet-related stuff.
Constructor Summary | |
---|---|
Cells(int rows,
int columns)
initializes the object without any column names and the given dimensions |
|
Cells(int rows,
int columns,
java.util.Collection names)
initializes the object with the given column names and dimensions |
Method Summary | |
---|---|
java.lang.Object |
getCellAt(int rowIndex,
int columnIndex)
returns the object at the given position, if it is an invalid position it returns NULL |
java.lang.String |
getCellStringAt(int rowIndex,
int columnIndex)
returns always a string, in case getCellAt(int,int) would return NULL this method returns the string 'null'. |
int |
getColumnCount()
returns the number of columns in the matrix |
java.lang.String |
getName(int columnIndex)
returns the name of the column, NULL if index of bounds or no names existing |
java.util.Vector |
getNames()
returns the names of the columns (could be an empty vector) |
int |
getRowCount()
returns the number of rows in the matrix |
boolean |
hasNames()
returns whether the Matrix has any column names |
boolean |
hasRowNumbers()
whether we also return row numbers (the first column) |
static void |
main(java.lang.String[] args)
for testing only |
void |
setCellAt(int rowIndex,
int columnIndex,
java.lang.Object value)
sets the cell |
void |
setColumnCount(int columns)
sets the number of columns in the matrix |
void |
setNames(java.util.Collection names)
sets the names of the columns |
void |
setRowCount(int rows)
sets the number of rows |
void |
setRowNumbers(boolean rowNumbers)
sets whether to returns also a column with row numbers |
java.lang.Object[][] |
toArray()
returns the matrix in a 2-dim array, the first |
java.util.Vector |
toCSV()
returns the matrix in a CSV format: text-qualifier=", separator=; |
java.lang.String |
toString()
returns the matrix in a string representation, i.e. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Cells(int rows, int columns)
public Cells(int rows, int columns, java.util.Collection names)
Method Detail |
---|
public void setNames(java.util.Collection names)
public java.util.Vector getNames()
public java.lang.String getName(int columnIndex)
public boolean hasNames()
public void setRowNumbers(boolean rowNumbers)
public boolean hasRowNumbers()
public void setColumnCount(int columns)
public int getColumnCount()
public void setRowCount(int rows)
public int getRowCount()
public void setCellAt(int rowIndex, int columnIndex, java.lang.Object value)
public java.lang.Object getCellAt(int rowIndex, int columnIndex)
public java.lang.String getCellStringAt(int rowIndex, int columnIndex)
public java.lang.Object[][] toArray()
public java.util.Vector toCSV()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |