org.apache.commons.collections.keyvalue

Class AbstractKeyValue

public abstract class AbstractKeyValue extends Object implements KeyValue

Abstract pair class to assist with creating KeyValue and java.util.Map.Entry Map.Entry implementations.

Since: Commons Collections 3.0

Version: $Revision: 405927 $ $Date: 2006-05-12 23:57:03 +0100 (Fri, 12 May 2006) $

Author: James Strachan Michael A. Smith Neil O'Toole Stephen Colebourne

Field Summary
protected Objectkey
The key
protected Objectvalue
The value
Constructor Summary
protected AbstractKeyValue(Object key, Object value)
Constructs a new pair with the specified key and given value.
Method Summary
ObjectgetKey()
Gets the key from the pair.
ObjectgetValue()
Gets the value from the pair.
StringtoString()
Gets a debugging String view of the pair.

Field Detail

key

protected Object key
The key

value

protected Object value
The value

Constructor Detail

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 Detail

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

Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.