public abstract class DefaultFileStorageEngine extends DefaultStorageEngine
| Constructor and Description |
|---|
DefaultFileStorageEngine(File file)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commits the Transaction
|
protected abstract HashMap<Class<? extends DataObject>,List<DataObject>> |
deserialize(File storageFile)
Deserializes the objects
|
void |
dispose()
Disposes the engine.
|
File |
getStorageFile() |
protected boolean |
isDoChanged()
Returns true, if the data model has changed since the last storage/load
operation.
|
<T extends DataObject> |
load(Class<T> clazz)
Loads a collection of data objects of a given type.
|
<T extends DataObject> |
load(Class<T> clazz,
String id)
Loads a data object of a specific type.
|
void |
remove(DataObject dataObject)
Removes a data object.
|
protected void |
removeDataObject(DataObject dataObject)
Removes a data object from the object container.
|
protected abstract void |
serialize(HashMap<Class<? extends DataObject>,List<DataObject>> objects,
File file)
Serializes the data objects.
|
protected void |
setDoChanged(boolean doChanged)
Sets the flag indicating if the data model has changed since the last
storage/load operation.
|
void |
setStorageFile(File storageFile) |
void |
store(DataObject dataObject)
Stores a data object.
|
void |
update(DataObject dataObject)
Updates a data object.
|
loadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopyTopublic DefaultFileStorageEngine(File file)
file - public void commit()
StorageEngineprotected abstract HashMap<Class<? extends DataObject>,List<DataObject>> deserialize(File storageFile)
storageFile - public void dispose()
StorageEnginepublic File getStorageFile()
public <T extends DataObject> List<T> load(Class<T> clazz)
StorageEnginepublic <T extends DataObject> T load(Class<T> clazz, String id)
StorageEnginepublic void remove(DataObject dataObject)
StorageEngineprotected void removeDataObject(DataObject dataObject)
dataObject - the data object to be removed.protected abstract void serialize(HashMap<Class<? extends DataObject>,List<DataObject>> objects, File file)
objects - file - public void setStorageFile(File storageFile)
public void store(DataObject dataObject)
StorageEnginepublic void update(DataObject dataObject)
StorageEngineprotected void setDoChanged(boolean doChanged)
doChanged - protected boolean isDoChanged()
Copyright © 2007-2012 Global Information Systems Group, ETH Zurich. All Rights Reserved.