ist.palcom.storage.persistent
Class PersistentStore

java.lang.Object
  extended by ist.palcom.storage.persistent.PersistentStore
Direct Known Subclasses:
TaggedPersistentStore

public class PersistentStore
extends java.lang.Object


Constructor Summary
PersistentStore(Storage store, java.lang.String fname, boolean clear)
          Create a PersistentStore
 
Method Summary
 int add(Persistent obj)
          Add an object to the PersistentStore
 void clear()
          Clear all ojects in the PersistentStore
 void close()
          Close the PersistentStore
 void compact()
          Compact the PersistentStore This is currently NOT implemented but will be needed
 void delete(int index)
          Delete an object in the PersistentStore
 void get(int index, Persistent obj)
          Get an object in the PersistentStore
 void open()
          Open a new PersistentStore
 void print(Persistent obj)
          Pretty print the PersistentStore, mostly for debugging
 void set(int index, Persistent obj)
          Change an object in the PersistentStore to a new object
 int size()
          Get the size of the PersistentStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentStore

public PersistentStore(Storage store,
                       java.lang.String fname,
                       boolean clear)
Create a PersistentStore

Parameters:
store - the Storage to use
fname - the filename for Storage to use
clear - to create a new file or append to an existing file
Method Detail

open

public void open()
Open a new PersistentStore


close

public void close()
Close the PersistentStore


clear

public void clear()
Clear all ojects in the PersistentStore


compact

public void compact()
Compact the PersistentStore This is currently NOT implemented but will be needed


add

public int add(Persistent obj)
Add an object to the PersistentStore

Parameters:
obj - the Object that should be added

set

public void set(int index,
                Persistent obj)
Change an object in the PersistentStore to a new object

Parameters:
index - the index of the old object
obj - the object that should be added

get

public void get(int index,
                Persistent obj)
Get an object in the PersistentStore

Parameters:
index - the index of the object
obj - a ref to the object

delete

public void delete(int index)
Delete an object in the PersistentStore

Parameters:
index - the index of the object

size

public int size()
Get the size of the PersistentStore


print

public void print(Persistent obj)
Pretty print the PersistentStore, mostly for debugging

Parameters:
obj - need a empty object as an template