Interface LabelMergeStrategy
-
public interface LabelMergeStrategyA 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 sameLabelclass). Moreover, some strategies only accept label of a certain type, and throw anIllegalArgumentExceptionif the type is wrong.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Labelmerge(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 anIllegalArgumentExceptionif 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).
-
-