|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.DataSet
The DataSet class. This class represents a data set as a "matrix" with cases as rows and variables as columns.
Constructor Summary | |
DataSet()
Constructs a new (empty) DataSet. |
|
DataSet(java.lang.String csvStringOrFileName,
char separator,
ParseListener parseListener)
Constructs a DataSet from a CSV specification provided in a file or as a string. |
Method Summary | |
void |
delete()
Deletes this DataSet. |
void |
deleteColumn(int column)
Deletes the specified column from this DataSet. |
void |
deleteRow(int row)
Deletes the specified row from this DataSet. |
java.lang.String |
getColumnName(int column)
Returns the name of the specified column of this DataSet. |
java.lang.String |
getDataItem(int row,
int column)
Returns the data item at the specified location of this DataSet. |
int |
getNumberOfColumns()
Returns the number of columns in this DataSet. |
int |
getNumberOfRows()
Returns the number of rows in this DataSet. |
java.lang.Object |
getUserData()
Returns the value stored within the user data slot of this DataSet. |
boolean |
isAlive()
Is this DataSet object alive? |
void |
moveColumn(int column,
int newColumn)
Moves the specified column to a new position. |
void |
moveRow(int row,
int newRow)
Moves the specified row to a new position. |
int |
newColumn(java.lang.String name)
Creates a new column in this DataSet. |
int |
newRow()
Creates a new row in this DataSet. |
void |
saveAsCSV(java.lang.String fileName,
char delimiter)
Saves this DataSet in the format of a comma-separated-values (CSV) file. |
void |
setColumnName(int column,
java.lang.String name)
Sets the name of the specified column of this DataSet. |
void |
setDataItem(int row,
int column,
java.lang.String data)
Sets (or deletes) the data item at the specified location of this DataSet. |
void |
setUserData(java.lang.Object data)
Sets the user data field of this DataSet. |
java.lang.String |
toCSVString(char delimiter)
Creates a CSV representation (as a string) of this DataSet. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataSet() throws ExceptionHugin
public DataSet(java.lang.String csvStringOrFileName, char separator, ParseListener parseListener) throws ExceptionHugin
csvStringOrFileName
- a string containing a CSV
specification or the name of a CSV fileseparator
- the separator character (must not be a
double-quote character)parseListener
- the ParseListener used for handling
parse errors.Method Detail |
public void delete() throws ExceptionHugin
ExceptionHugin
public int getNumberOfColumns() throws ExceptionHugin
ExceptionHugin
public int getNumberOfRows() throws ExceptionHugin
ExceptionHugin
public java.lang.String getDataItem(int row, int column) throws ExceptionHugin
row
- the index of the rowcolumn
- the index of the column
ExceptionHugin
public void setDataItem(int row, int column, java.lang.String data) throws ExceptionHugin
row
- the index of the rowcolumn
- the index of the columndata
- the new data item (a null
value causes
the item to be deleted).
ExceptionHugin
public java.lang.String getColumnName(int column) throws ExceptionHugin
column
- the index of the column
ExceptionHugin
public void setColumnName(int column, java.lang.String name) throws ExceptionHugin
column
- the index of the columnname
- the new name of the column
ExceptionHugin
public boolean isAlive()
public int newColumn(java.lang.String name) throws ExceptionHugin
name
- the name of the new column
ExceptionHugin
public int newRow() throws ExceptionHugin
ExceptionHugin
public void moveColumn(int column, int newColumn) throws ExceptionHugin
column
- the index of the column to be movednewColumn
- the index of the destination column
ExceptionHugin
public void moveRow(int row, int newRow) throws ExceptionHugin
row
- the index of the row to be movednewRow
- the index of the destination row
ExceptionHugin
public void deleteColumn(int column) throws ExceptionHugin
column
- the index of the column to be deleted
ExceptionHugin
public void deleteRow(int row) throws ExceptionHugin
row
- the index of the row to be deleted
ExceptionHugin
public void saveAsCSV(java.lang.String fileName, char delimiter) throws ExceptionHugin
fileName
- the name of the file in which to store the datadelimiter
- the delimiter character (must not be a
double-quote character).
ExceptionHugin
public java.lang.String toCSVString(char delimiter) throws ExceptionHugin
delimiter
- the delimiter character (must not be a
double-quote character).
ExceptionHugin
public java.lang.Object getUserData()
public void setUserData(java.lang.Object data)
data
- User-defined data associated with this DataSet.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |