public class Pair<F,S> extends java.lang.Object implements KeyValuePair<F,S>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
F |
first
The first object.
|
S |
second
The second object.
|
Constructor and Description |
---|
Pair() |
Pair(F first,
S second)
Constructor for holding a pair of objects.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns
true if obj is also a Pair and contains two
objects equal to the two objects of this Pair. |
F |
getKey()
Return the first object
|
S |
getValue()
Return the second object
|
int |
hashCode()
Builds a new hash code out of the two objects' hash codes.
|
java.lang.String |
toString() |
public F getKey()
getKey
in interface KeyValuePair<F,S>
public S getValue()
getValue
in interface KeyValuePair<F,S>
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
true
if obj
is also a Pair and contains two
objects equal to the two objects of this Pair. null
references are
considered as equal, too.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.