Package hec.io
Class AbstractDataStorage
java.lang.Object
hec.io.AbstractDataStorage
- All Implemented Interfaces:
DataStorage
- Direct Known Subclasses:
DBFDataStorage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
addNewObject
(Object obj) add a new object to the DataStore return its id.addNewObject2
(Object obj) add the object returning the objectboolean
backupData
(String backupDir, DataObject obj) callNativeMethod
(Object obj) call a native method in the DataStore base on the class type of obj.void
compress()
This method is used to compress a datafile.long
protected Method[]
getMethodsByName
(String methodName) return a list of methods that have the methodNameint
loadObject
(String name, String objClass) method required by DataStorage for local access to objects from rmiDataListboolean
reload()
called when we're supposed to dump all our in memory data and reload from disk.boolean
removeObject
(long[] objId, String objClass) boolean
removeObject
(long objId, String objClass) remove an objectboolean
save()
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hec.io.DataStorage
getDataObjectIdList, getObjectList, init, loadObject, storeObject
-
Constructor Details
-
AbstractDataStorage
public AbstractDataStorage()
-
-
Method Details
-
getObjectCount
public int getObjectCount()- Specified by:
getObjectCount
in interfaceDataStorage
-
getFilename
- Specified by:
getFilename
in interfaceDataStorage
-
callNativeMethod
call a native method in the DataStore base on the class type of obj.- Specified by:
callNativeMethod
in interfaceDataStorage
-
getMethodsByName
return a list of methods that have the methodName -
addNewObject2
add the object returning the object- Specified by:
addNewObject2
in interfaceDataStorage
-
addNewObject
Description copied from interface:DataStorage
add a new object to the DataStore return its id.- Specified by:
addNewObject
in interfaceDataStorage
-
save
public boolean save()- Specified by:
save
in interfaceDataStorage
-
removeObject
Description copied from interface:DataStorage
remove an object- Specified by:
removeObject
in interfaceDataStorage
-
removeObject
- Specified by:
removeObject
in interfaceDataStorage
-
workspaceClosing
public void workspaceClosing()- Specified by:
workspaceClosing
in interfaceDataStorage
-
loadObject
method required by DataStorage for local access to objects from rmiDataList- Specified by:
loadObject
in interfaceDataStorage
-
backupData
- Specified by:
backupData
in interfaceDataStorage
-
reload
public boolean reload()called when we're supposed to dump all our in memory data and reload from disk.- Specified by:
reload
in interfaceDataStorage
-
getLastModifiedTime
public long getLastModifiedTime()- Specified by:
getLastModifiedTime
in interfaceDataStorage
-
compress
public void compress()This method is used to compress a datafile. Some data storage implemenations will buffer the record deletes by marking a delete flag. Call this to remove those records.- Specified by:
compress
in interfaceDataStorage
-