uk.ac.ic.doc.automed.qproc.cache
Class CacheObjectBinding

java.lang.Object
  extended by com.sleepycat.bind.tuple.TupleBase
      extended by com.sleepycat.bind.tuple.TupleBinding
          extended by uk.ac.ic.doc.automed.util.persist.AbstractObjectBinding
              extended by uk.ac.ic.doc.automed.qproc.cache.CacheObjectBinding
All Implemented Interfaces:
com.sleepycat.bind.EntryBinding

public class CacheObjectBinding
extends AbstractObjectBinding

CacheObjectBinding.java

Custom binding of essential CacheItem attributes for persistency

Author:
Duc M Le dmle@doc.ic.ac.uk
Created on August 3, 2006
Department of Computing, Imperial College

Constructor Summary
CacheObjectBinding()
           
 
Method Summary
 java.lang.Object entryToObject(com.sleepycat.bind.tuple.TupleInput ti)
          Convert a database entry into a CacheItem object
 PersistentKey getKey(java.lang.Object object)
          Return a PersistentKey object from the value object
 void objectToEntry(java.lang.Object object, com.sleepycat.bind.tuple.TupleOutput to)
          Write a CachItem object to a persistent database
 
Methods inherited from class com.sleepycat.bind.tuple.TupleBinding
entryToObject, getPrimitiveBinding, objectToEntry
 
Methods inherited from class com.sleepycat.bind.tuple.TupleBase
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheObjectBinding

public CacheObjectBinding()
Method Detail

getKey

public PersistentKey getKey(java.lang.Object object)
Description copied from class: AbstractObjectBinding
Return a PersistentKey object from the value object

Specified by:
getKey in class AbstractObjectBinding

entryToObject

public java.lang.Object entryToObject(com.sleepycat.bind.tuple.TupleInput ti)
Convert a database entry into a CacheItem object

Specified by:
entryToObject in class AbstractObjectBinding
Parameters:
ti - is the tuple key or data entry.
Returns:
the key or data object constructed from the entry.

objectToEntry

public void objectToEntry(java.lang.Object object,
                          com.sleepycat.bind.tuple.TupleOutput to)
Write a CachItem object to a persistent database

Specified by:
objectToEntry in class AbstractObjectBinding
Parameters:
object - is the key or data object.
to - is the tuple entry to which the key or data should be written.