org.xorm.cache
Class RowCacheKeyFactory

java.lang.Object
  |
  +--org.xorm.cache.RowCacheKeyFactory

public class RowCacheKeyFactory
extends Object

Utility class used by the LRUCache to generate keys for the Rows it must store. This class produces a key suitable for using in a hash. This class is used, due to the anticiaption of other types of objects eventually being cached in the LRUCache.

Author:
Harry Evans

Constructor Summary
RowCacheKeyFactory()
           
 
Method Summary
 Object getCacheKey(Object value)
          Take a row and return a key for it.
 Object makeRowPrimaryKey(Table table, Object rowId)
          Take a table and a row primary key, and make a cachable key for it.
 Object makeRowPrimaryKey(Table table, Row row)
          Take a table and a row, and make a cachable key for it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowCacheKeyFactory

public RowCacheKeyFactory()
Method Detail

getCacheKey

public Object getCacheKey(Object value)
Take a row and return a key for it.

Parameters:
value - the Row to generate the key for, as an Object
Returns:
an opaque key for the Row.
Throws:
ClassCastException - if the object is not a Row.

makeRowPrimaryKey

public Object makeRowPrimaryKey(Table table,
                                Row row)
Take a table and a row, and make a cachable key for it.

Parameters:
table - the Table the row belongs to
row - the Row to generate the key for, as an Object
Returns:
an opaque key for the Row.

makeRowPrimaryKey

public Object makeRowPrimaryKey(Table table,
                                Object rowId)
Take a table and a row primary key, and make a cachable key for it.

Parameters:
table - the Table the row belongs to
rowId - the primary key of the Row object to be cached
Returns:
an opaque key for the Row.


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/cache/RowCacheKeyFactory.html,v 1.3 2004/05/30 08:55:04 wbiggs Exp $