net.sourceforge.xconf.toolbox.generic
Class Pair<L,R>
java.lang.Object
net.sourceforge.xconf.toolbox.generic.Pair<L,R>
- All Implemented Interfaces:
- Serializable, Comparable<Pair<L,R>>
public class Pair<L,R>
- extends Object
- implements Comparable<Pair<L,R>>, Serializable
Generic holder class for when you absolutely need to return more than one object from a method,
or when you need to use more than one object as a map key or collection entry.
- Author:
- Tom Czarniecki
- See Also:
- Serialized Form
Pair
public Pair()
Pair
public Pair(L left,
R right)
create
public static <L,R> Pair<L,R> create(L left,
R right)
getLeft
public L getLeft()
setLeft
public void setLeft(L left)
getRight
public R getRight()
setRight
public void setRight(R right)
compareTo
public int compareTo(Pair<L,R> other)
- Specified by:
compareTo in interface Comparable<Pair<L,R>>
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2007 Thomas Czarniecki. All Rights Reserved.