Package eu.bandm.tools.umod.runtime
Class CheckedCoPair_R<L,R>
java.lang.Object
eu.bandm.tools.umod.runtime.UncheckedCoPair<L,R>
eu.bandm.tools.umod.runtime.CheckedCoPair_R<L,R>
- Type Parameters:
L- the type of the left alternativesR- the type of the right alternatives
- All Implemented Interfaces:
CoPair<L,,R> CoPair_checkedRight<L,,R> Serializable
Facade to "CoPair" operations and guarantees strictness of right variant,
by overwriting "set_right()"
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCheckedCoPair_R(boolean b, R right) Create a copair of the "right" alternative.CheckedCoPair_R(CoPair<L, R> p) Create a copair with the same values as the prototype.CheckedCoPair_R(L left) Create a copair of the "left" alternative. -
Method Summary
Methods inherited from class eu.bandm.tools.umod.runtime.UncheckedCoPair
get_left, get_right, hashCode, isLeft, set_left, toString, xEquals
-
Constructor Details
-
CheckedCoPair_R
Create a copair of the "left" alternative.- Parameters:
left- the value stored in this copair.
-
CheckedCoPair_R
Create a copair of the "right" alternative.- Parameters:
b- a marker parameter which chooses the right alternative. Can have arbitrary value.right- the value stored in this copair.- Throws:
NullPointerException- if the argument is null.
-
CheckedCoPair_R
Create a copair with the same values as the prototype.- Parameters:
p- the prototype- Throws:
NullPointerException- if the argument realizes the right variant and has the null value.
-
-
Method Details
-
set_right
Set this instance to realizes the right variant and set its value.- Specified by:
set_rightin interfaceCoPair<L,R> - Overrides:
set_rightin classUncheckedCoPair<L,R> - Parameters:
r- the value to be stored.- Throws:
NullPointerException- if the value is null
-
equals
- Overrides:
equalsin classUncheckedCoPair<L,R>
-