org.pf.util
Class Association

java.lang.Object
  extended by org.pf.util.Association
All Implemented Interfaces:
java.io.Serializable, java.util.Map.Entry
Direct Known Subclasses:
MapEntry, NamedValue

public class Association
extends java.lang.Object
implements java.util.Map.Entry, java.io.Serializable

Simple association of a key object and a value object.
Access to key and value is provided by

Version:
1.3
Author:
Manfred Duchrow
See Also:
Serialized Form

Constructor Summary
Association()
          Initialize the new instance with default values.
Association(java.lang.Object key, java.lang.Object value)
          Initialize the new instance with a key an a value.
 
Method Summary
 Association copyAssociation()
          Returns a copy of this object
 boolean equals(java.lang.Object obj)
           
 java.lang.Object getKey()
           
 java.lang.Object getValue()
           
 int hashCode()
           
 java.lang.Object key()
          Returns the key of the association.
 void key(java.lang.Object newKey)
          Sets the key of the association.
 java.lang.Object setValue(java.lang.Object value)
           
 java.lang.String toString()
          Returns the toString() value of key and value separated by "->".
 java.lang.Object value()
          Returns the value of the association.
 void value(java.lang.Object newValue)
          Sets the value of the association.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Association

public Association()
Initialize the new instance with default values.


Association

public Association(java.lang.Object key,
                   java.lang.Object value)
Initialize the new instance with a key an a value.

Method Detail

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.util.Map.Entry
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map.Entry
Overrides:
hashCode in class java.lang.Object

key

public java.lang.Object key()
Returns the key of the association.


key

public void key(java.lang.Object newKey)
Sets the key of the association.


value

public java.lang.Object value()
Returns the value of the association.


value

public void value(java.lang.Object newValue)
Sets the value of the association.


toString

public java.lang.String toString()
Returns the toString() value of key and value separated by "->".

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getKey

public java.lang.Object getKey()
Specified by:
getKey in interface java.util.Map.Entry
See Also:
Map.Entry.getKey()

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface java.util.Map.Entry
See Also:
Map.Entry.getValue()

setValue

public java.lang.Object setValue(java.lang.Object value)
Specified by:
setValue in interface java.util.Map.Entry
See Also:
Map.Entry.setValue(java.lang.Object)

copyAssociation

public Association copyAssociation()
Returns a copy of this object