kodkod.util.collections
Class Pair<F,S>

java.lang.Object
  extended by kodkod.util.collections.Pair<F,S>

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

A container class consisting of two elements of types.

Author:
Emina Torlak
specfield:
first: F
second: S

Constructor Summary
Pair(F first, S second)
          Constructs a pair out of the given elements.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if o is a Pair with first and last equals to this first and second.
 F first()
          Returns this.first.
 int hashCode()
           
 S second()
          Returns this.second.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(F first,
            S second)
Constructs a pair out of the given elements.

effects:
this.first' = first and this.second' = second
Method Detail

first

public F first()
Returns this.first.

Returns:
this.first

second

public S second()
Returns this.second.

Returns:
this.second

equals

public boolean equals(java.lang.Object o)
Returns true if o is a Pair with first and last equals to this first and second.

Overrides:
equals in class java.lang.Object
Returns:
this.first.equals(o.first) and this.second.equals(o.second)
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

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