cascading.tuple.util

## Class TupleHasher

- java.lang.Object
- - cascading.tuple.util.TupleHasher

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    HasherPartitioner

      public class TupleHasher
      extends Object
      implements Serializable

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TupleHasher.HashFunction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TupleHasher.HashFunction` | `hashFunction`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleHasher()`
    `TupleHasher(Comparator defaultComparator, Comparator[] comparators)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected TupleHasher.HashFunction` | `getHashFunction()`
    `int` | `hashCode(Tuple tuple)`
    `protected void` | `initialize(Comparator defaultComparator, Comparator[] comparators)`
    `static boolean` | `isNull(Comparator[] comparators)`
    `static Comparator[]` | `merge(Fields[] keyFields)`
    `static Tuple` | `wrapTuple(TupleHasher tupleHasher, Tuple input)` Wraps the given Tuple in a subtype, that uses the provided Hasher for hashCode calculations.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### hashFunction

          protected TupleHasher.HashFunction hashFunction

  - ### Constructor Detail

    - #### TupleHasher

          public TupleHasher()

    - #### TupleHasher

          public TupleHasher(Comparator defaultComparator,
                     Comparator[] comparators)

  - ### Method Detail

    - #### merge

          public static Comparator[] merge(Fields[] keyFields)

    - #### isNull

          public static boolean isNull(Comparator[] comparators)

    - #### initialize

          protected void initialize(Comparator defaultComparator,
                        Comparator[] comparators)

    - #### hashCode

          public final int hashCode(Tuple tuple)

    - #### getHashFunction

          protected TupleHasher.HashFunction getHashFunction()

    - #### wrapTuple

          public static Tuple wrapTuple(TupleHasher tupleHasher,
                        Tuple input)

      Wraps the given Tuple in a subtype, that uses the provided Hasher for hashCode calculations. If the given Hasher is `null` the input Tuple will be returned.
      Parameters:
        `tupleHasher` - A TupleHasher instance.
        `input` - A Tuple instance.
      Returns:
        A tuple using the provided TupleHasher for hashCode calculations if the TupleHasher is not null.

Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.