-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashFunction.java
More file actions
18 lines (17 loc) · 647 Bytes
/
HashFunction.java
File metadata and controls
18 lines (17 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/****************************************************************************
* File: HashFunction.java
* Author: Keith Schwarz (htiek@cs.stanford.edu)
*
* An object representing a hash function capable of hashing objects of some
* type. This allows the notion of a hash function to be kept separate from
* the object itself and is necessary to provide families of hash functions.
*/
public interface HashFunction<T> {
/**
* Given an object, returns the hash code of that object.
*
* @param obj The object whose hash code should be computed.
* @return The object's hash code.
*/
public int hash(T obj);
}