org.planx.util
Class Association<T,S>

java.lang.Object
  extended by org.planx.util.Association<T,S>
All Implemented Interfaces:
Pair<T,S>
Direct Known Subclasses:
TemplateNode, TemplateNode.Pointer

public class Association<T,S>
extends Object
implements Pair<T,S>

A mutable implementation of Pair.

Author:
Thomas Ambus

Field Summary
protected  T first
           
protected  S second
           
 
Constructor Summary
Association(T first, S second)
           
 
Method Summary
 boolean equals(Object o)
          Returns true if and only if the specified object is also a Pair and its first and second components are pairwise equal to this object's first and second components using the equals method (or pairwise null).
 T getFirst()
          Returns the first component of the Pair.
 S getSecond()
          Returns the second component of the Pair.
 int hashCode()
           
 void setFirst(T o)
           
 void setSecond(S o)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

first

protected T first

second

protected S second
Constructor Detail

Association

public Association(T first,
                   S second)
Method Detail

getFirst

public T getFirst()
Description copied from interface: Pair
Returns the first component of the Pair.

Specified by:
getFirst in interface Pair<T,S>

setFirst

public void setFirst(T o)

getSecond

public S getSecond()
Description copied from interface: Pair
Returns the second component of the Pair.

Specified by:
getSecond in interface Pair<T,S>

setSecond

public void setSecond(S o)

equals

public boolean equals(Object o)
Returns true if and only if the specified object is also a Pair and its first and second components are pairwise equal to this object's first and second components using the equals method (or pairwise null).

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.