L - Type of 'left' object to be heldR - Type of 'right' object to be heldpublic class MutablePair<L,R> extends Pair<L,R>
Pair which allows the stored references to be updated after
creation. Note that stored references are not volatile or synchronized, so
thread access must be guarded in synchronization.| Constructor and Description |
|---|
MutablePair()
Constructs a new mutable pair with the left and right references defaulted to be
null. |
MutablePair(L left,
R right)
Constructs a new mutable pair, providing the left and right objects to be held.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setLeft(L left)
Update the left reference with the provided object.
|
void |
setRight(R right)
Update the right reference with the provided object.
|
applyToLeft, applyToRight, collectLeft, collectRight, containsLeft, containsRight, convertMap, equals, getLeft, getLeftFromRight, getRight, getRightFromLeft, hashCode, iterateLeft, iterateLeft, iterateRight, iterateRight, split, toString, transform, transformLeft, transformRightpublic MutablePair()
null.public void setLeft(L left)
left - New reference to be used for the left of the pairpublic void setRight(R right)
right - New reference to be used for the right of the pair