Package tools.helperclasses
Class MutablePair<T,U>
Object
AbstractPair<T,U>
AbstractMutablePair<T,U>
MutablePair<T,U>
public class MutablePair<T,U> extends AbstractMutablePair<T,U>
-
Constructor Summary
Constructors Constructor Description MutablePair(Map.Entry<T,U> entry)Creates a mutable pair using a map entryMutablePair(AbstractPair<T,U> pair)Creates a mutable pair using another pairMutablePair(T first, U second)Creates a mutable pair by specifying its values -
Method Summary
Modifier and Type Method Description TgetFirst()Returns the value of the first item in the pairUgetSecond()Returns the value of the second item in the pairTsetFirst(T first)Sets the first item in the pair and returns the old valueUsetSecond(U second)Sets the second item in the pair and returns the old value
-
Constructor Details
-
MutablePair
Creates a mutable pair by specifying its values- Parameters:
first- first value in the pairsecond- second value in the pair
-
MutablePair
Creates a mutable pair using another pair- Parameters:
pair- the pair containing the values to be used
-
MutablePair
Creates a mutable pair using a map entry- Parameters:
entry- the entry containing the values to be used
-
-
Method Details
-
getFirst
Description copied from class:AbstractPairReturns the value of the first item in the pair- Specified by:
getFirstin classAbstractPair<T,U>- Returns:
- the value of the first item in the pair
-
getSecond
Description copied from class:AbstractPairReturns the value of the second item in the pair- Specified by:
getSecondin classAbstractPair<T,U>- Returns:
- the value of the second item in the pair
-
setFirst
Description copied from class:AbstractMutablePairSets the first item in the pair and returns the old value- Specified by:
setFirstin classAbstractMutablePair<T,U>- Parameters:
first- the future value of the first item- Returns:
- the old value of the first item
-
setSecond
Description copied from class:AbstractMutablePairSets the second item in the pair and returns the old value- Specified by:
setSecondin classAbstractMutablePair<T,U>- Parameters:
second- the future value of the second item- Returns:
- the old value of the second item
-