public class MemoryStorage extends Storage
KEY_MOUNT_OVERLAY_PATH, KEY_MOUNT_OVERLAY_PRIO, KEY_MOUNT_PATH, KEY_MOUNT_TIME, KEY_READWRITE, PATH_STORAGE, PATH_STORAGE_CACHE, PATH_STORAGEINFO
dict, KEY_CLASSNAME, KEY_ID, KEY_TYPE
Constructor and Description |
---|
MemoryStorage(boolean readWrite,
boolean storageInfo)
Creates a new memory storage.
|
Modifier and Type | Method and Description |
---|---|
int |
count()
Returns the number of objects currently in this storage.
|
void |
destroy()
Destroys this storage.
|
boolean |
isStorable(java.lang.Object obj)
Checks if the specified object is supported in this storage.
|
java.lang.Object |
load(Path path)
Loads an object from the specified location.
|
Metadata |
lookup(Path path)
Searches for an object at the specified location and returns
metadata about the object if found.
|
void |
remove(Path path)
Removes an object or an index at the specified location.
|
Dict |
serialize()
Returns a serialized representation of this object.
|
void |
store(Path path,
java.lang.Object data)
Stores an object at the specified location.
|
compareTo, isReadWrite, loadAll, localPath, lookupAll, mountOverlayPath, mountOverlayPrio, mountTime, path, setMountInfo
activate, id, init, isActive, isModified, passivate, toString, type
public MemoryStorage(boolean readWrite, boolean storageInfo)
readWrite
- the read write flagstorageInfo
- the show storage info flagpublic boolean isStorable(java.lang.Object obj)
obj
- the object instance to checkpublic void destroy()
destroy
in class StorableObject
public Dict serialize()
serialize
in class StorableObject
public int count()
public Metadata lookup(Path path)
public java.lang.Object load(Path path)
public void store(Path path, java.lang.Object data) throws StorageException
store
in class Storage
path
- the storage locationdata
- the data to storeStorageException
- if the data couldn't be writtenpublic void remove(Path path) throws StorageException
remove
in class Storage
path
- the storage locationStorageException
- if the data couldn't be removed