|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.iu.iv.common.persistence.ivc.DelimitedDenseDoubleMatrixModelPersister
This persister can restore dense matrices to a delimited file. The extension for such files should be ".mat". The format for such a file is as follows: The first line should start with the delimiter, then the number of rows and columns. This delimiter is used as the delimiter throughout the file. The second line stores the row labels preceded by the string "RowLabels" (case-insensitive) and the delimiter The labels must be separated by the delimiter again. The third line stores the column labels preceded by the string "columnlabels" (case-insensitive) and the delimiter. The labels must be separated by the delimiter again. The fourth line has the string "Data" (case-insensitive) followed by a delimiter. Finally the data of the matrix is stored in file, with each row occupying a line in the file. The elements of the matrix must be separated by the delimiter again. An example of a complete file:
,5,5 rowlabels,doc1,doc2,doc3,doc4,doc5 columnlabels,term1,term2,term3,term4,term5 data, 11,12,13,14,15 21,22,23,24,25 31,32,33,34,35 41,42,43,44,45 51,52,53,54,55The labels are optional and you may provide only some of the labels if you wish. For example, the following line: rowlabels,doc1,,doc3,,doc5 will assign labels only to rows 1, 3 and 5 and set the rest to an empty string "".
| Constructor Summary | |
DelimitedDenseDoubleMatrixModelPersister()
|
|
| Method Summary | |
boolean |
canPersist(java.lang.Object model)
Determines if this persister can persist the given data model to the given data resource. |
boolean |
canRestore(ResourceDescriptor resource)
Determines if this persister can restore the given data model from the given data resource. |
PropertyMap |
getPropertyMap()
Gets a property map describing this persister and file format (if applicable). |
void |
persist(java.lang.Object model,
ResourceDescriptor dataSource)
Persists a data model to a resource such as a file or database. |
java.lang.Object |
restore(ResourceDescriptor dataSource)
Restores a model from the specified resource. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DelimitedDenseDoubleMatrixModelPersister()
| Method Detail |
public PropertyMap getPropertyMap()
Persister
getPropertyMap in interface PersisterPersister.getPropertyMap()
public void persist(java.lang.Object model,
ResourceDescriptor dataSource)
throws java.io.IOException,
PersistenceException
Persister
persist in interface Persistermodel - The model to be persisted.dataSource - The resource to persist the model to.
java.io.IOException
PersistenceExceptionPersister.persist(java.lang.Object, edu.iu.iv.core.persistence.ResourceDescriptor)
public java.lang.Object restore(ResourceDescriptor dataSource)
throws java.io.IOException,
PersistenceException,
java.lang.OutOfMemoryError
Persister
restore in interface Persisterjava.io.IOException
PersistenceException
java.lang.OutOfMemoryErrorPersister.restore(edu.iu.iv.core.persistence.ResourceDescriptor)public boolean canPersist(java.lang.Object model)
canPersist in interface Persistermodel - The model to be persisted.
Persister.canPersist(java.lang.Object)public boolean canRestore(ResourceDescriptor resource)
canRestore in interface Persisterresource - The resource from which restoration is desired.
An example of a resource is a file on disk.
Persister.canRestore(ResourceDescriptor)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||