1 /////////////////////////////////////////////////////////////////////////////// 2 // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. 3 // 4 // This library is free software; you can redistribute it and/or 5 // modify it under the terms of the GNU Lesser General Public 6 // License as published by the Free Software Foundation; either 7 // version 2.1 of the License, or (at your option) any later version. 8 // 9 // This library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public 15 // License along with this program; if not, write to the Free Software 16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 /////////////////////////////////////////////////////////////////////////////// 18 19 package gnu.trove; 20 21 import java.io.Serializable; 22 23 /** 24 * Interface to support pluggable hashing strategies in maps and sets. 25 * Implementors can use this interface to make the trove hashing 26 * algorithms use an optimal strategy when computing hashcodes. 27 * 28 * Created: Sun Nov 4 08:56:06 2001 29 * 30 * @author Eric D. Friedman 31 * @version $Id: TDoubleHashingStrategy.java,v 1.4 2004/11/09 15:48:46 ericdf Exp $ 32 */ 33 34 public interface TDoubleHashingStrategy extends Serializable { 35 /** 36 * Computes a hash code for the specified double. Implementors 37 * can use the double's own value or a custom scheme designed to 38 * minimize collisions for a known set of input. 39 * 40 * @param double for which the hashcode is to be computed 41 * @return the hashCode 42 */ 43 public int computeHashCode(double val); 44 } // TDoubleHashingStrategy 45