Interface LabelMergeStrategy
public interface LabelMergeStrategy
A way to merge two labels into one; the actual merge is performed by the
merge(Label, Label)
method. Usually, strategies require that the two labels provided are of
the same kind (i.e., instances of the same Label
class). Moreover, some strategies only accept label of a certain type,
and throw an IllegalArgumentException
if the type
is wrong.-
Method Summary
-
Method Details
-
merge
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).
-