messif.buckets.storage
Interface IntStorage<T>

Type Parameters:
T - the class of objects stored in this storage
All Superinterfaces:
java.io.Serializable, Storage<T>
All Known Subinterfaces:
IntStorageIndexed<T>
All Known Implementing Classes:
DatabaseStorage, MemoryStorage

public interface IntStorage<T>
extends Storage<T>

Interface for storage that uses int addresses. The store(T) method stores the provided object into the storage and returns its address. This address can be used to read(int) or remove the object at any time later.


Method Summary
 T read(int address)
          Reads the object stored at the specified address in this storage.
 void remove(int address)
          Removes the object stored at the specified address in this storage.
 IntAddress<T> store(T object)
          Stores an object in this storage.
 
Methods inherited from interface messif.buckets.storage.Storage
destroy, finalize
 

Method Detail

store

IntAddress<T> store(T object)
                    throws BucketStorageException
Description copied from interface: Storage
Stores an object in this storage. The address returned by this call can be used to retrieve or remove the object.

Specified by:
store in interface Storage<T>
Parameters:
object - the object to store
Returns:
the address where the object has been stored
Throws:
BucketStorageException - if there was an error writing the data

read

T read(int address)
       throws BucketStorageException
Reads the object stored at the specified address in this storage.

Parameters:
address - the address of the object to read
Returns:
the object retrieved
Throws:
BucketStorageException - if there was an error reading the data

remove

void remove(int address)
            throws BucketStorageException,
                   java.lang.UnsupportedOperationException
Removes the object stored at the specified address in this storage. This operation is optional and need not be implemented.

Parameters:
address - the address of the object to remove
Throws:
BucketStorageException - if there was an error deleting an object
java.lang.UnsupportedOperationException - if this storage does not support removal of objects