messif.buckets.storage
Class LongAddress<T>

java.lang.Object
  extended by messif.buckets.storage.LongAddress<T>
Type Parameters:
T - the class of objects that this address points to
All Implemented Interfaces:
java.io.Serializable, Address<T>

public final class LongAddress<T>
extends java.lang.Object
implements Address<T>

Implementation of Address for a storage that uses long addresses.

See Also:
Storage, Serialized Form

Constructor Summary
LongAddress(LongStorage<T> storage, long address)
          Creates a new instance of IntAddress on the specified int storage.
 
Method Summary
 long getAddress()
          Returns the associated long address into the storage.
 T read()
          Reads the object stored at this address from the associated storage.
 void remove()
          Removes the object stored at this address from the associated storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongAddress

public LongAddress(LongStorage<T> storage,
                   long address)
Creates a new instance of IntAddress on the specified int storage.

Parameters:
storage - the storage on which this address is valid
address - the int address in the storage this IntAddress points to
Method Detail

getAddress

public long getAddress()
Returns the associated long address into the storage.

Returns:
the associated long address into the storage

read

public T read()
       throws BucketStorageException
Description copied from interface: Address
Reads the object stored at this address from the associated storage.

Specified by:
read in interface Address<T>
Returns:
the object retrieved
Throws:
BucketStorageException - if there was an error reading the data

remove

public void remove()
            throws BucketStorageException,
                   java.lang.UnsupportedOperationException
Description copied from interface: Address
Removes the object stored at this address from the associated storage. This operation is optional and need not be implemented.

Specified by:
remove in interface Address<T>
Throws:
BucketStorageException - if there was an error deleting an object
java.lang.UnsupportedOperationException - if this storage does not support removal of objects