All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.Hashing

java.lang.Object
   |
   +----COM.objectspace.jgl.algorithms.Hashing

public final class Hashing
extends Object
The Hashing class contains generic hashing algorithms.


Method Index

 o orderedHash(Container)
Compute an hash value for an ordered container.
 o orderedHash(ForwardIterator, ForwardIterator)
Compute a hash value for a range of elements in an ordered container Hashing on an ordered container requires that all elements in the container that are used in the hash have the position taken into account.
 o unorderedHash(Container)
Compute an hash value for an unordered container.
 o unorderedHash(ForwardIterator, ForwardIterator)
Compute a hash value for a range of elements in an uordered container.

Methods

 o orderedHash
 public static int orderedHash(Container c)
Compute an hash value for an ordered container.

 o orderedHash
 public static int orderedHash(ForwardIterator first,
                               ForwardIterator last)
Compute a hash value for a range of elements in an ordered container Hashing on an ordered container requires that all elements in the container that are used in the hash have the position taken into account. The hashing scheme uses all contained elements if the size of the range is less than HASH_SIZE. If the size of the range is > HASH_SIZE, only representative samples are used to increase performance. Position is taken into account for each element used in the hash by taking the position modulo HASH_SIZE plus one and using this result as a divisor on the actual hash code of the element.

Parameters:
first - An iterator positioned at the first element of the sequence.
last - An iterator positioned immediately after the last element of the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o unorderedHash
 public static int unorderedHash(Container c)
Compute an hash value for an unordered container.

 o unorderedHash
 public static int unorderedHash(ForwardIterator first,
                                 ForwardIterator last)
Compute a hash value for a range of elements in an uordered container. Hashing on an unordered container requires that all elements in the container are used in the hash. A simple XOR scheme is used over all elements to ensure that equality is maintained over like ranges.

Parameters:
first - An iterator positioned at the first element of the sequence.
last - An iterator positioned immediately after the last element of the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.

All Packages  Class Hierarchy  This Package  Previous  Next  Index