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 TypeMethodDescriptionlongaddNewObject(Object obj) add a new object to the DataStore return its id.addNewObject2(Object obj) add the object returning the objectbooleanbackupData(String backupDir, DataObject obj) callNativeMethod(Object obj) call a native method in the DataStore base on the class type of obj.voidcompress()This method is used to compress a datafile.longprotected Method[]getMethodsByName(String methodName) return a list of methods that have the methodNameintloadObject(String name, String objClass) method required by DataStorage for local access to objects from rmiDataListbooleanreload()called when we're supposed to dump all our in memory data and reload from disk.booleanremoveObject(long[] objId, String objClass) booleanremoveObject(long objId, String objClass) remove an objectbooleansave()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hec.io.DataStorage
getDataObjectIdList, getObjectList, init, loadObject, storeObject
-
Constructor Details
-
AbstractDataStorage
public AbstractDataStorage()
-
-
Method Details
-
getObjectCount
public int getObjectCount()- Specified by:
getObjectCountin interfaceDataStorage
-
getFilename
- Specified by:
getFilenamein interfaceDataStorage
-
callNativeMethod
call a native method in the DataStore base on the class type of obj.- Specified by:
callNativeMethodin interfaceDataStorage
-
getMethodsByName
return a list of methods that have the methodName -
addNewObject2
add the object returning the object- Specified by:
addNewObject2in interfaceDataStorage
-
addNewObject
Description copied from interface:DataStorageadd a new object to the DataStore return its id.- Specified by:
addNewObjectin interfaceDataStorage
-
save
public boolean save()- Specified by:
savein interfaceDataStorage
-
removeObject
Description copied from interface:DataStorageremove an object- Specified by:
removeObjectin interfaceDataStorage
-
removeObject
- Specified by:
removeObjectin interfaceDataStorage
-
workspaceClosing
public void workspaceClosing()- Specified by:
workspaceClosingin interfaceDataStorage
-
loadObject
method required by DataStorage for local access to objects from rmiDataList- Specified by:
loadObjectin interfaceDataStorage
-
backupData
- Specified by:
backupDatain interfaceDataStorage
-
reload
public boolean reload()called when we're supposed to dump all our in memory data and reload from disk.- Specified by:
reloadin interfaceDataStorage
-
getLastModifiedTime
public long getLastModifiedTime()- Specified by:
getLastModifiedTimein 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:
compressin interfaceDataStorage
-