org.apache.directory.server.xdbm
Class Tuple<K,V>

java.lang.Object
  extended by org.apache.directory.server.xdbm.Tuple<K,V>

public class Tuple<K,V>
extends java.lang.Object

A key/value tuple for simple two column persistent Tables with sorted keys.

Version:
$Rev: 640657 $
Author:
Apache Directory Project

Constructor Summary
Tuple()
          Do nothing default that has a null key and null value.
Tuple(K key, V value)
          Creates a Tuple using a key and a value.
 
Method Summary
 K getKey()
          Gets the key for this Tuple.
 V getValue()
          Gets the value for this Tuple.
 Tuple<K,V> setBoth(K key, V value)
          Sets both the key and the value for this Tuple in one call and returns this Tuple object.
 Tuple<K,V> setBoth(Tuple<K,V> tupleToCopy)
          Sets both the key and the value for this Tuple in one call and returns this Tuple object.
 Tuple<K,V> setKey(K key)
          Sets the key for this Tuple.
 Tuple<K,V> setValue(V value)
          Sets the value for this Tuple.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tuple

public Tuple()
Do nothing default that has a null key and null value.


Tuple

public Tuple(K key,
             V value)
Creates a Tuple using a key and a value.

Parameters:
key - the key to set
value - the value to set
Method Detail

getKey

public K getKey()
Gets the key for this Tuple.

Returns:
the Tuple's key

setKey

public Tuple<K,V> setKey(K key)
Sets the key for this Tuple.

Parameters:
key - the new key to set
Returns:
this Tuple itself to set and return

getValue

public V getValue()
Gets the value for this Tuple.

Returns:
the Tuple's value

setValue

public Tuple<K,V> setValue(V value)
Sets the value for this Tuple.

Parameters:
value - the new value to set
Returns:
this Tuple itself to set and return

setBoth

public Tuple<K,V> setBoth(K key,
                          V value)
Sets both the key and the value for this Tuple in one call and returns this Tuple object. This is useful for setting the tuples key and value then returning it.

Parameters:
key - the new key to set
value - the new value to set
Returns:
this Tuple itself to set and return

setBoth

public Tuple<K,V> setBoth(Tuple<K,V> tupleToCopy)
Sets both the key and the value for this Tuple in one call and returns this Tuple object. This is useful for setting the tuples key and value then returning it.

Parameters:
tupleToCopy - the tuple to copy
Returns:
this Tuple itself to set and return

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.