org.planx.util
Class Association<T,S>
java.lang.Object
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
|
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()
|
first
protected T first
second
protected S second
Association
public Association(T first,
S second)
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.