/*
 * @(#)RecordRBTDictionary.java	1.0 2004/06/09
 */
   
/**
 * RecordRBTDictionary selects the primaryKey in class Record as the 
 * record key used for indexing.
 * RecordRBTDictionary is an extention of a RedBlackTree (RBT) 
 * container class that implements the interface indexable.
 * @see Indexable, RedBlackTree. 
 */
public class RecordRBTDictionary extends RedBlackTree {
	
	/** Selects x.primaryKey as the record's key */
	public Comparable getRecordKey(Object x) {
   		return (x == null) ? null:((Record)x).primaryKey;
   	}
   
	/** Returns true if x is of a class Record. */
	public boolean validateRecordClass(Object x) {
		return (x instanceof Record);
	}
	
	/*
	  NOTE: if you inherit from HashTable instead of
	  RedBlackTree, you must define the hashKey(). For example,
	  
	  protected int hashKey(Comparable key) {
	  	Integer k = (Integer)key;
		// add you key hashing code here
	  }
	  
	  This must also be done in the classes that inherit from
	  RecordXYZDictionary if getRecordKey() returns something else than
	  an Integer.
	 */
	
}


