Interface LabelMergeStrategy
-
public interface LabelMergeStrategy
A way to merge two labels into one; the actual merge is performed by themerge(Label, Label)
method. Usually, strategies require that the two labels provided are of the same kind (i.e., instances of the sameLabel
class). Moreover, some strategies only accept label of a certain type, and throw anIllegalArgumentException
if the type is wrong.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Label
merge(Label first, Label second)
Merges two given labels; either label may benull
, but not both.
-
-
-
Method Detail
-
merge
Label merge(Label first, Label second)
Merges two given labels; either label may benull
, but not both. Implementing classes may decide to throw anIllegalArgumentException
if the labels provided are not of the same type, or not of a specific type.- Parameters:
first
- the first label to be merged.second
- the second label to be merged.- Returns:
- the resulting label (note that the returned label may be reused by the
implementing class, so users are invited to make a
Label.copy()
of it if they need to keep the label in between calls).
-
-