Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cascading.tuple.hadoop.util
Class BytesComparator

    java.lang.Object
      cascading.tuple.hadoop.util.BytesComparator

All Implemented Interfaces:
  Hasher<byte[]>, StreamComparator<BufferedInputStream>, Serializable, Comparator<byte[]>

    public class BytesComparator

extends Object
implements StreamComparator<BufferedInputStream>, Hasher<byte[]>, Comparator<byte[]>, Serializable

Class BytesComparator is used to compare arrays of bytes.

Note that BytesComparator implements `Hasher`, but for the Hasher interface to be applied during grouping, sorting or joining, it must be set on a `Fields` instance via `Fields.setComparator(Comparable, java.util.Comparator)`.

See Also:
  Serialized Form

Constructor Summary
`BytesComparator()`

Method Summary
`int` | `compare(BufferedInputStream lhsStream, BufferedInputStream rhsStream)`
`int` | `compare(byte[] lhs, byte[] rhs)`
`int` | `hashCode(byte[] value)` Return the hashCode of the given value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface java.util.Comparator
`equals`

Constructor Detail

### BytesComparator

    public BytesComparator()

Method Detail

### compare

    public int compare(byte[] lhs,
                       byte[] rhs)

  Specified by:
    `compare` in interface `Comparator<byte[]>`

### compare

    public int compare(BufferedInputStream lhsStream,
                       BufferedInputStream rhsStream)

  Specified by:
    `compare` in interface `StreamComparator<BufferedInputStream>`

### hashCode

    public int hashCode(byte[] value)

  Description copied from interface: `Hasher`
  Return the hashCode of the given value.

  Specified by:
    `hashCode` in interface `Hasher<byte[]>`
  Parameters:
    `value` - will never be null
  Returns:
    int hashCode of given value

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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