org.apache.directory.mavibot.btree.comparator

## Class ByteArrayComparator

- java.lang.Object
- - org.apache.directory.mavibot.btree.comparator.ByteArrayComparator

- All Implemented Interfaces:
    Comparator<byte[]>

      public class ByteArrayComparator
      extends Object
      implements Comparator<byte[]>

  Compares byte arrays.
  Author:
    Apache Directory Project

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ByteArrayComparator` | `INSTANCE` A static instance of a ByteArrayComparator

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(byte[] byteArray1, byte[] byteArray2)` Compare two byte arrays.

    - ### 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`

- - ### Field Detail

    - #### INSTANCE

          public static final ByteArrayComparator INSTANCE

      A static instance of a ByteArrayComparator

  - ### Method Detail

    - #### compare

          public int compare(byte[] byteArray1,
                    byte[] byteArray2)

      Compare two byte arrays.
      Specified by:
        `compare` in interface `Comparator<byte[]>`
      Parameters:
        `byteArray1` - First byteArray
        `byteArray2` - Second byteArray
      Returns:
        1 if byteArray1 > byteArray2, 0 if byteArray1 == byteArray2, -1 if byteArray1 < byteArray2

Copyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.