|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdata.SerialManager
public class SerialManager
Low layer class to interact with the data in disk
Nested Class Summary | |
---|---|
static class |
SerialManager.MyFilter
It allows to create a custom FilenameFilter in an easy way |
Field Summary | |
---|---|
static java.lang.String |
PATH_MATRIX
Path to the matrix folder (where they will be saved) |
static java.lang.String |
PATH_WORKSPACE
Path to the workspace folder (where they will be saved) |
Constructor Summary | |
---|---|
SerialManager()
|
Method Summary | |
---|---|
static void |
deleteMatrix(java.lang.String filename)
Deletes a Matrix from the library and Workspaces referencing it |
static void |
deleteObject(java.lang.String fileName,
java.lang.String filePath,
java.lang.String fileExt)
Deletes an object from the disk. |
static void |
deleteWorkspace(java.lang.String filename)
Deletes a Workspace from the saved ones |
static void |
exportMatrix(java.lang.String matName,
java.lang.String exportName,
java.lang.String exportPath)
Export a saved Matrix from the Matrix directory to another arbitrary directory |
private static boolean |
fileExists(java.lang.String fileName,
java.lang.String filePath,
java.lang.String fileExt)
Returns if a given file exists in the given path |
private static java.lang.String[] |
getFileNames(java.lang.String filePath,
java.lang.String fileExt)
Return the names of the files with the given extension in the given path |
static java.lang.String[] |
getMatrixNames()
Retun the names of all Matrix in the Library |
static java.lang.String[] |
getWorkspaceNames()
Retun the names of all Workspace saved |
static Matrix |
loadMatrix(java.lang.String filename)
Return the Matrix previously saved with the given name |
private static java.lang.Object |
loadObject(java.lang.String fileName,
java.lang.String filePath,
java.lang.String fileExt)
Loads any object from disk. |
static Workspace |
loadWorkspace(java.lang.String filename)
Return the Workspace previously saved with the given name |
static boolean |
matrixExists(java.lang.String matName)
Returns if a Matrix with this name exists |
static void |
saveMatrix(Matrix m,
java.lang.String filename)
Saves a matrix object with the given name |
private static void |
saveObject(java.lang.Object o,
java.lang.String fileName,
java.lang.String dirPath,
java.lang.String fileExt)
Saves any object in disk. |
static void |
saveWorkspace(Workspace w,
java.lang.String filename)
Saves a Workspace object with the given name |
static java.lang.String |
updateMatrix(java.lang.String matName,
java.lang.String newName,
java.lang.String newDesc)
Updates a saved Matrix attributes with the given ones |
static boolean |
workspaceExists(java.lang.String wsName)
Returns if a Workspace with this name exists |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PATH_MATRIX
public static final java.lang.String PATH_WORKSPACE
Constructor Detail |
---|
public SerialManager()
Method Detail |
---|
private static final void saveObject(java.lang.Object o, java.lang.String fileName, java.lang.String dirPath, java.lang.String fileExt) throws DataException
o
- Object to be savedfileName
- File's namedirPath
- Path (directory) where to save the filefileExt
- File's extension
DataException
private static final java.lang.Object loadObject(java.lang.String fileName, java.lang.String filePath, java.lang.String fileExt) throws DataException
fileName
- Name of the object to be loadedfilePath
- Path (directory structure) of the object to be loadedfileExt
- Extension of the loaded object
DataException
public static final void deleteObject(java.lang.String fileName, java.lang.String filePath, java.lang.String fileExt) throws DataException
fileName
- Name of the file to be deletedfilePath
- Path (directory structure) of the object to be deletedfileExt
- Extension of the object wich will be deleted
DataException
private static final java.lang.String[] getFileNames(java.lang.String filePath, java.lang.String fileExt)
filePath
- Path (folder route) which will be lookedfileExt
- Desired file's extension
private static final boolean fileExists(java.lang.String fileName, java.lang.String filePath, java.lang.String fileExt)
fileName
- File's namefilePath
- Path where look for the filefileExt
- File's extension
public static final void saveMatrix(Matrix m, java.lang.String filename) throws DataException
m
- Matrix objectfilename
- Desired name
DataException
public static final void saveWorkspace(Workspace w, java.lang.String filename) throws DataException
w
- Workspace objectfilename
- Desired name
DataException
public static final Matrix loadMatrix(java.lang.String filename) throws DataException
filename
- Name of the Matrix
DataException
public static final Workspace loadWorkspace(java.lang.String filename) throws DataException
filename
- Name of the Workspace
DataException
public static final java.lang.String updateMatrix(java.lang.String matName, java.lang.String newName, java.lang.String newDesc) throws DataException
matName
- Name of the MatrixnewName
- New name of the matrixnewDesc
- New description of the matrix
DataException
public static final void exportMatrix(java.lang.String matName, java.lang.String exportName, java.lang.String exportPath) throws DataException
matName
- Name of the Matrix wich will be exportedexportName
- Desired name of the exportationexportPath
- Desired exportation path
DataException
public static final void deleteMatrix(java.lang.String filename) throws DataException
filename
- Name of the Matrix to be deleted
DataException
public static final void deleteWorkspace(java.lang.String filename) throws DataException
filename
- Name of the Workspace to be deleted
DataException
public static final boolean matrixExists(java.lang.String matName)
matName
- Matrix name
public static final boolean workspaceExists(java.lang.String wsName)
wsName
- Workspace name
public static final java.lang.String[] getMatrixNames()
public static final java.lang.String[] getWorkspaceNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |