ostore.cache
Class CacheableHandle

java.lang.Object
  |
  +--ostore.cache.CacheableHandle

public class CacheableHandle
extends Object

Handle to an object stored in the cache. To pin a page, one trades this handle for a CacheablePinned handle.


Method Summary
 Cacheable data()
          return the Casheable block from the cache that this Handle points to.
 boolean equals(Object other)
          Compares this CacheablePinned with another , and returns true iff they are the same object.
 int getSize()
          the size of the Cacheable block in the cache
 int hashCode()
          Calculates a Java hash code for this CacheablePinned object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

data

public Cacheable data()
               throws CastOutException
return the Casheable block from the cache that this Handle points to.

Throws:
CastOutException - if the block has been evicted

equals

public boolean equals(Object other)
Compares this CacheablePinned with another , and returns true iff they are the same object. i.e. They point to the same place in memory, the are the same reference.

Overrides:
equals in class Object
Parameters:
other - the object with which to compare this CacheablePinned.
Returns:
true iff this and other are the same reference.

hashCode

public int hashCode()
Calculates a Java hash code for this CacheablePinned object. (Returns the Object.hashCode() [i.e. super.hashCode()] which as much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Returns:
the Java hash code for this CacheablePinned.

getSize

public int getSize()
the size of the Cacheable block in the cache