org.garret.serme
Class Persistent

java.lang.Object
  extended byorg.garret.serme.Persistent
All Implemented Interfaces:
ISerializable
Direct Known Subclasses:
SortedCollection

public abstract class Persistent
extends java.lang.Object
implements ISerializable

Class which remembers the storage to which it belongs. When objet is loaded from ther storage, the reference to this storage is saved in the object using setStorage method. Using this reference to the storage, object can store or remove himself from the storage.


Constructor Summary
Persistent()
           
 
Method Summary
 IStorage getStorage()
          Get storage where object is stored
 void remove()
          Remove object from the storage
 void setStorage(IStorage storage)
          Specify storage for the object.
 void store()
          Save object in the storage (if any)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.garret.serme.ISerializable
readObject, writeObject
 

Constructor Detail

Persistent

public Persistent()
Method Detail

getStorage

public IStorage getStorage()
Get storage where object is stored

Returns:
storage containing object, null if object is not persistent

remove

public void remove()
Remove object from the storage


setStorage

public void setStorage(IStorage storage)
Specify storage for the object. This method is mostly used by SerME internals and should not be directly invoked by programmer

Parameters:
storage - associated storage

store

public void store()
Save object in the storage (if any)