L - the type for the left element in the pairR - the type for the right element in the pair@ThreadSafe
public class Pair<L,R>
extends java.lang.Object
| Constructor and Description |
|---|
Pair()
Constructs a new empty pair.
|
Pair(L left,
R right)
Constructs a new Pair with the given left and right values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Determines the equality of this and the provided object.
|
L |
getLeft()
Get the value of left.
|
R |
getRight()
Get the value of right.
|
int |
hashCode()
Generates the hash code using the hash codes from the contained objects.
|
void |
setLeft(L left)
Set the value of left.
|
void |
setRight(R right)
Set the value of right.
|
public L getLeft()
public void setLeft(L left)
left - new value of leftpublic R getRight()
public void setRight(R right)
right - new value of rightpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the Object to check for equality to thisObject are equal; otherwise
falseCopyright© 2012-21 Jeremy Long. All Rights Reserved.