PCJ API
Version 1.2

bak.pcj.hash
Class DefaultBooleanHashFunction

java.lang.Object
  extended bybak.pcj.hash.DefaultBooleanHashFunction
All Implemented Interfaces:
BooleanHashFunction, Serializable

public class DefaultBooleanHashFunction
extends Object
implements BooleanHashFunction, Serializable

This class provides a default hash function for boolean values. It has been derived from the Java library and is known to work well in the general case.

Since:
1.0
See Also:
Boolean.hashCode()

Field Summary
static BooleanHashFunction INSTANCE
          Default instance of this hash function.
 
Constructor Summary
protected DefaultBooleanHashFunction()
          Default constructor to be invoked by sub-classes.
 
Method Summary
 int hash(boolean v)
          Returns a hash code for a specified boolean value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final BooleanHashFunction INSTANCE
Default instance of this hash function.

Constructor Detail

DefaultBooleanHashFunction

protected DefaultBooleanHashFunction()
Default constructor to be invoked by sub-classes.

Method Detail

hash

public int hash(boolean v)
Description copied from interface: BooleanHashFunction
Returns a hash code for a specified boolean value.

Specified by:
hash in interface BooleanHashFunction
Parameters:
v - the value for which to return a hash code.
Returns:
a hash code for the specified value.

PCJ API
Version 1.2

Report a bug or request a feature.
Further information on the development and latest release of PCJ can be found at the project homepage.

Primitive Collections for Java is released under the GNU Lesser General Public License.
Copyright © 2002, 2003 Søren Bak. All Rights Reserved.

Hosted by SourceForge.net
SourceForge.net Logo