org.apache.directory.mavibot.btree

## Class Tuple<K,V>

- java.lang.Object
- - org.apache.directory.mavibot.btree.Tuple<K,V>

- Type Parameters:
    `K` - The type for the Key
    `V` - The type for the stored value
  All Implemented Interfaces:
    Comparable<Tuple<K,V>>

      public class Tuple<K,V>
      extends Object
      implements Comparable<Tuple<K,V>>

  The Tuple class is used when we browse a btree, it will contain the results fetched from the btree.
  Author:
    Apache Directory Project

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected K` | `key` The key
    `protected Comparator<K>` | `keyComparator` The key comparator
    `protected V` | `value` The value

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Tuple()` Creates a Tuple with no content
    `Tuple(K key, V value)` Creates a Tuple containing a key and its associated value.
    `Tuple(K key, V value, Comparator<K> keyComparator)` Creates a Tuple containing a key and its associated value.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Tuple<K,V> t)`
    `boolean` | `equals(Object obj)`
    `K` | `getKey()`
    `Comparator<K>` | `getKeyComparator()`
    `V` | `getValue()`
    `int` | `hashCode()`
    `void` | `setKey(K key)`
    `void` | `setKeyComparator(Comparator<K> keyComparator)`
    `void` | `setValue(V value)`
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### key

          protected K key

      The key

    - #### value

          protected V value

      The value

    - #### keyComparator

          protected Comparator<K> keyComparator

      The key comparator

  - ### Constructor Detail

    - #### Tuple

          public Tuple()

      Creates a Tuple with no content

    - #### Tuple

          public Tuple(K key,
               V value)

      Creates a Tuple containing a key and its associated value.
      Parameters:
        `key` - The key
        `value` - The associated value

    - #### Tuple

          public Tuple(K key,
               V value,
               Comparator<K> keyComparator)

      Creates a Tuple containing a key and its associated value.
      Parameters:
        `key` - The key
        `value` - The associated value

  - ### Method Detail

    - #### getKey

          public K getKey()

      Returns:
        the key

    - #### setKey

          public void setKey(K key)

      Parameters:
        `key` - the key to set

    - #### getValue

          public V getValue()

      Returns:
        the value

    - #### setValue

          public void setValue(V value)

      Parameters:
        `value` - the value to set

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`
      See Also:
        `Object.hashCode()`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`
      See Also:
        `Object#equals()`

    - #### compareTo

          public int compareTo(Tuple<K,V> t)

      Specified by:
        `compareTo` in interface `Comparable<Tuple<K,V>>`
      See Also:
        `Comparable.compareTo(java.lang.Object)`

    - #### getKeyComparator

          public Comparator<K> getKeyComparator()

      Returns:
        the keyComparator

    - #### setKeyComparator

          public void setKeyComparator(Comparator<K> keyComparator)

      Parameters:
        `keyComparator` - the keyComparator to set

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`
      See Also:
        `Object.toString()`

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