All Packages Class Hierarchy This Package Previous Next Index
Class jgl.Hashing
java.lang.Object
|
+----jgl.Hashing
- public final class Hashing
- extends Object
The Hashing class contains generic hashing algorithms.
- Version:
- JOS-FileSystem 4 Preview (25-Mar-98)
- Author:
- ObjectSpace, Inc.
-
Hashing()
-
-
orderedHash(Container)
- Compute an hash value for an ordered container.
-
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.
-
unorderedHash(Container)
- Compute an hash value for an unordered container.
-
unorderedHash(ForwardIterator, ForwardIterator)
- Compute a hash value for a range of elements in an
uordered container.
Hashing
public Hashing()
orderedHash
public static int orderedHash(Container c)
- Compute an hash value for an ordered container.
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 16. If the size of the range
is > 16, 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 16 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.
unorderedHash
public static int unorderedHash(Container c)
- Compute an hash value for an unordered container.
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.
All Packages Class Hierarchy This Package Previous Next Index