org.jgrapht.experimental.equivalence
Interface EquivalenceComparatorChain<E,C>
- Type Parameters:
E
- the type of the elements in the setC
- the type of the context the element is compared against, e.g. a
Graph
- All Superinterfaces:
- EquivalenceComparator<E,C>
- All Known Implementing Classes:
- EquivalenceComparatorChainBase
public interface EquivalenceComparatorChain<E,C>
- extends EquivalenceComparator<E,C>
A container of comparators, which are tested in a chain until the first
result can be supplied. It implements the EquivalenceComparator, so chains
can include other chains. The first check will use the current comparator and
not the next one. So, make sure to use the one which has better performance
first. (This class follows the "Composite" design-pattern).
- Since:
- Jul 22, 2005
- Author:
- Assaf
appendComparator
void appendComparator(EquivalenceComparator<E,C> comparatorAfter)
- Adds a comparator which will also test equivalence. For
equivalenceCompare(), the return value is a logical AND of the two
comparators. The first check will use the first comparator before the
next one. Make sure to put the one which has better performance first.
For equivalenceHashcode(), the resulting hashes will be rehashed
together. This method may be used multiple times to create a long "chain"
of comparators.
Copyright © 2013. All rights reserved.