SableJBDD.cache
Class CacheEntry

java.lang.Object
  extended bySableJBDD.cache.CacheEntry

public class CacheEntry
extends java.lang.Object

A cache entry keeps a key and value, it is caller's option to use weak references for keys and values.


Constructor Summary
CacheEntry()
          Defines an empty cache entry.
CacheEntry(int k0, int k1, int k2, java.lang.Object v)
          Defines a cache entry with a (key, value) pair.
 
Method Summary
 boolean empty()
          Checks if the entry holds a null value.
 java.lang.Object getValue()
           
 boolean matches(int k0, int k1, int k2)
          Checks if the entry matches a key.
 void mutate(int k0, int k1, int k2, java.lang.Object v)
          Mutates an entry to old another key value pair
 void reset()
          Resets cache entry
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheEntry

public CacheEntry()
Defines an empty cache entry.


CacheEntry

public CacheEntry(int k0,
                  int k1,
                  int k2,
                  java.lang.Object v)
Defines a cache entry with a (key, value) pair.

Method Detail

mutate

public void mutate(int k0,
                   int k1,
                   int k2,
                   java.lang.Object v)
Mutates an entry to old another key value pair


matches

public boolean matches(int k0,
                       int k1,
                       int k2)
Checks if the entry matches a key.

Parameters:
k0 - the 1st key
k1 - the 2nd key
k2 - the 3rd key
Returns:
true, if the key of this entry equals the matching key

empty

public boolean empty()
Checks if the entry holds a null value.


reset

public void reset()
Resets cache entry


getValue

public java.lang.Object getValue()
Returns:
the value object of this entry