[all packages]
[package net.sf.pizzacompiler.lang]
[class hierarchy]
[index]
public class net.sf.pizzacompiler.lang.Pair<A, B>
(source file: /home/enno/source/tmp/pizza/main/src/net/sf/pizzacompiler/lang/Pair.pizza)
java.lang.Object
|
+----net.sf.pizzacompiler.lang.Pair<A, B>
The pure class interface.
public class Pair<A, B>
implements java.io.Serializable
-
A class for pairs of data. Provides the posibility to store two
elements of not necessarily different type in an object.
Example:
Pair<int, String> myPair = new Pair(7, "seven");
System.out.println(myPair.fst + " is " + myPair.snd);
- Pair(A, B)
- Creates a pair of data.
- fst
-
- snd
-
- equals(Object)
- Is this pair (structurally) equal to another pair?
- hashCode()
-
Returns a hashcode for this pair.
- toString()
- Returns a string representation of this pair.
Pair
public case Pair(A fst,
B snd);
- Creates a pair of data.
- Parameters:
- fst - first element
- snd - second element
fst
public A fst;
snd
public B snd;
hashCode
public int hashCode();
-
Returns a hashcode for this pair.
- Overrides:
- hashCode in class Object
- See also:
- pizza.util.Hashtable
equals
public boolean equals(Object other);
- Is this pair (structurally) equal to another pair?
- Parameters:
- other - the pair to compare this pair with
- Returns:
- true if other is a pair and both elements are equal to
the elements in this pair
- Overrides:
- equals in class Object
toString
public String toString();
- Returns a string representation of this pair.
- Overrides:
- toString in class Object
[all packages]
[package net.sf.pizzacompiler.lang]
[class hierarchy]
[index]
net.sf.pizzacompiler.lang.Pair.html