com.glaivestone.javax.util
Class BasicAssociation

java.lang.Object
  |
  +--com.glaivestone.javax.util.BasicAssociation
All Implemented Interfaces:
Association

public class BasicAssociation
extends java.lang.Object
implements Association

This class implements Association to represent a key-value pair.

Version:
1.0
Author:
Gary Gregory

Constructor Summary
BasicAssociation(java.lang.Object key)
          Create an Association with the given key.
BasicAssociation(java.lang.Object key, java.lang.Object value)
          Create an Association with the given key and value.
 
Method Summary
 java.lang.Object getKey()
          Return the key.
 java.lang.Object getValue()
          Return the value.
 int hashCode()
          Return the key hashCode() if the key is not null, otherwise return super's hashCode().
 void setKey(java.lang.Object key)
          Set the key.
 void setValue(java.lang.Object value)
          Set the value.
 java.lang.String toString()
          Return a String representation of the receiver.
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicAssociation

public BasicAssociation(java.lang.Object key)
Create an Association with the given key.


BasicAssociation

public BasicAssociation(java.lang.Object key,
                        java.lang.Object value)
Create an Association with the given key and value.

Method Detail

setKey

public void setKey(java.lang.Object key)
Set the key.

Specified by:
setKey in interface Association

getKey

public java.lang.Object getKey()
Return the key.

Specified by:
getKey in interface Association

setValue

public void setValue(java.lang.Object value)
Set the value.

Specified by:
setValue in interface Association

getValue

public java.lang.Object getValue()
Return the value.

Specified by:
getValue in interface Association

hashCode

public int hashCode()
Return the key hashCode() if the key is not null, otherwise return super's hashCode().

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Return a String representation of the receiver. This method returns a string equal to the value of:
 this.getKey() + " => " + this.getValue()
 

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

GFL 1.1 API