Copyright© 2008-2022 Sitevision AB, all rights reserved.
@Requireable(value="CompoundComparatorBuilder") public interface CompoundComparatorBuilder extends Builder<Comparator<Node>>
How the compareTo method of a compound comparator works: If comparator A and comparator B is added to this builder, then the compareTo method of A will be invoked first, and if equal (i.e. zero), the compareTo of B will be invoked.
See Builder for a comprehensive example of how to work with builders.
An instance of the Sitevision class implementing this interface can be obtained via
NodeComparatorUtil.getCompoundComparatorBuilder().
See NodeComparatorUtil for how to obtain an instance of the NodeComparatorUtil interface.
| Modifier and Type | Method and Description |
|---|---|
CompoundComparatorBuilder |
addComparator(Comparator<Node> aComparator)
Adds a node comparator to this builder.
|
Comparator<Node> |
build()
Creates a node comparator instance that will calculate its compareTo return value based on currently specified comparators.
|
CompoundComparatorBuilder |
clearComparators()
Removes all previously added comparators.
|
CompoundComparatorBuilder addComparator(Comparator<Node> aComparator)
Note! Order is important. The compareTo method of a node comparator constructed from this builder will invoke the comparators in the order they were added.
aComparator - the node comparator to add, null will be ignoredCompoundComparatorBuilder clearComparators()
Comparator<Node> build() throws IllegalStateException
Note! The returned Comparator imposes orderings that are inconsistent with equals.
build in interface Builder<Comparator<Node>>IllegalStateException - if this builder contains no comparators.Sitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.