Package eu.bandm.tools.umod.runtime
Interface CoPair<L,R>
- Type Parameters:
L- the type of the left componentsR- the type of the right components
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
CoPair_checkedLeft<L,,R> CoPair_checkedRight<L,R>
- All Known Implementing Classes:
CheckedCoPair_L,CheckedCoPair_LR,CheckedCoPair_R,UncheckedCoPair
Interface defining copair operations.
A copair represents the selection between two sets of values.
These can have the same or different types.
Implementing instances are mutable objects.
Here no strictness is implied, but some subclasses do.
-
Method Summary
Modifier and TypeMethodDescriptionget_left()As usual.+/ static final long serialVersionUID = -6377989869262315836L; /** Return the stored value, if this instance realizes the left variant.Return the stored value, if this instance realizes the right variant.booleanisLeft()Return whether this instance realizes the left variant.voidSet this instance to realizes the left variant and set its value.voidSet this instance to realizes the right variant and set its value.
-
Method Details
-
get_left
As usual.+/ static final long serialVersionUID = -6377989869262315836L; /** Return the stored value, if this instance realizes the left variant.- Returns:
- the stored value, if this instance realizes the left variant.
- Throws:
IllegalStateException- if this instance does not realize the left variant.
-
get_right
Return the stored value, if this instance realizes the right variant.- Returns:
- the stored value, if this instance realizes the right variant.
- Throws:
IllegalStateException- if this instance does not realize the realize variant.
-
isLeft
boolean isLeft()Return whether this instance realizes the left variant.- Returns:
- whether this instance realizes the left variant.
-
set_left
Set this instance to realizes the left variant and set its value.- Parameters:
l- the value to be stored.- Throws:
NullPointerException- if the implementing class does not permit null values as a left variant.
-
set_right
Set this instance to realizes the right variant and set its value.- Parameters:
r- the value to be stored.- Throws:
NullPointerException- if the implementing class does not permit null values as a right variant.
-