|
|||||||||
| 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(long column)
Deletes the specified column from this DataSet. |
void |
deleteRow(long row)
Deletes the specified row from this DataSet. |
java.lang.String |
getColumnName(long column)
Returns the name of the specified column of this DataSet. |
java.lang.String |
getDataItem(long row,
long column)
Returns the data item at the specified location of this DataSet. |
long |
getNumberOfColumns()
Returns the number of columns in this DataSet. |
long |
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(long column,
long newColumn)
Moves the specified column to a new position. |
void |
moveRow(long row,
long newRow)
Moves the specified row to a new position. |
long |
newColumn(java.lang.String name)
Creates a new column in this DataSet. |
long |
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(long column,
java.lang.String name)
Sets the name of the specified column of this DataSet. |
void |
setDataItem(long row,
long 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 long getNumberOfColumns()
throws ExceptionHugin
ExceptionHugin
public long getNumberOfRows()
throws ExceptionHugin
ExceptionHugin
public java.lang.String getDataItem(long row,
long column)
throws ExceptionHugin
row - the index of the rowcolumn - the index of the column
ExceptionHugin
public void setDataItem(long row,
long 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(long column)
throws ExceptionHugin
column - the index of the column
ExceptionHugin
public void setColumnName(long column,
java.lang.String name)
throws ExceptionHugin
column - the index of the columnname - the new name of the column
ExceptionHuginpublic boolean isAlive()
public long newColumn(java.lang.String name)
throws ExceptionHugin
name - the name of the new column
ExceptionHugin
public long newRow()
throws ExceptionHugin
ExceptionHugin
public void moveColumn(long column,
long newColumn)
throws ExceptionHugin
column - the index of the column to be movednewColumn - the index of the destination column
ExceptionHugin
public void moveRow(long row,
long newRow)
throws ExceptionHugin
row - the index of the row to be movednewRow - the index of the destination row
ExceptionHugin
public void deleteColumn(long column)
throws ExceptionHugin
column - the index of the column to be deleted
ExceptionHugin
public void deleteRow(long 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).
ExceptionHuginpublic 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 | ||||||||