net.fenyo.gnetwatch
Class Pair<E,F>

java.lang.Object
  extended by net.fenyo.gnetwatch.Pair<E,F>

public class Pair<E,F>
extends java.lang.Object

This utility class groups objects by pairs.

Version:
$Id: Pair.java,v 1.7 2008/04/15 23:58:17 fenyo Exp $
Author:
Alexandre Fenyo

Field Summary
private  E e
           
private  F f
           
 
Constructor Summary
Pair(E e, F f)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Two pairs are equal if their respective first and last objects are equal.
 E former()
          Returns the first object.
 int hashCode()
          Returns a hashcode.
 F latter()
          Returns the last object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

e

private final E e

f

private final F f
Constructor Detail

Pair

public Pair(E e,
            F f)
Constructor.

Parameters:
e - first object.
f - last object.
Method Detail

former

public E former()
Returns the first object.

Parameters:
none. -
Returns:
E first object.

latter

public F latter()
Returns the last object.

Parameters:
none. -
Returns:
F last object.

equals

public boolean equals(java.lang.Object o)
Two pairs are equal if their respective first and last objects are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - another pair.
Returns:
boolean true in case of equality.

hashCode

public int hashCode()
Returns a hashcode.

Overrides:
hashCode in class java.lang.Object
Parameters:
none. -
Returns:
int hashcode.