⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.keyvalue

Class AbstractKeyValue

java.lang.Object
|
+--org.apache.commons.collections.keyvalue.AbstractKeyValue

All Implemented Interfaces:
KeyValue

Known Direct Subclasses:
AbstractMapEntry, DefaultKeyValue


public abstract class AbstractKeyValue
extends java.lang.Object
implements KeyValue

Abstract pair class to assist with creating KeyValue and MapEntry implementations.
Since:
Commons Collections 3.0
Authors:
James Strachan
Michael A. Smith
Neil O'Toole
Stephen Colebourne

Field Summary

Object

key

The key

Object

value

The value

Constructor Summary

AbstractKeyValue(Object key, Object value)

Constructs a new pair with the specified key and given value.

Method Summary

Object

getKey()

Gets the key from the pair.

Object

getValue()

Gets the value from the pair.

String

toString()

Gets a debugging String view of the pair.

Field Details

key

protected Object key

The key


value

protected Object value

The value

Constructor Details

AbstractKeyValue

protected AbstractKeyValue(Object key, Object value)

Constructs a new pair with the specified key and given value.

Parameters:
key - the key for the entry, may be null
value - the value for the entry, may be null

Method Details

getKey

public Object getKey()

Gets the key from the pair.

Returns:
the key

getValue

public Object getValue()

Gets the value from the pair.

Returns:
the value

toString

public String toString()

Gets a debugging String view of the pair.

Returns:
a String view of the entry