/* * SearchKey.java - an interface for Searching for objects * * Copyright (c) 1996 Chuck McManis, All Rights Reserved. * * Permission to use, copy, modify, and distribute this software * and its documentation for NON-COMMERCIAL purposes and without * fee is hereby granted provided that this copyright notice * appears in all copies. * * CHUCK MCMANIS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. CHUCK MCMANIS * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ /** * This interface defines the methods that a search key must implement. * It is very important that for a given object that implements this * interface its "value" not change once it is stored into a tree. Thus * the values that the methods operate on must be immutable. */ public interface SearchKey { /** * Return an integer value whose magnitude is relative to the * comparison of two objects. */ public abstract int compareKey(SearchKey key); /** * Return true if these two search keys are equal. */ public boolean equalKey(SearchKey key); }