Class BaseMatcher<T>

  • Type Parameters:
    T - the type representing the domain of matching
    Direct Known Subclasses:
    ComputingMatcher, FindingMatcher

    public abstract class BaseMatcher<T>
    extends Object
    Abstract base class for all matchers. Matching is an algorithm that matches two collections of things of type T resulting in a reversible mapping between the elements of the respective collections. By definition two empty collections of elements match with an empty bijective mapping. The bijective mapping that is produced by matching is always encoded in instances of the class AliasMap. Matchers operate on a generic type T. However, the underlying mechanics always works on instances of class CorrelationIdentifier. This separates the concept of equality from the actual objects that the client logic matches over. This class keeps maps to track object-to-alias and alias-to-object relationships. To clients (that is logic extending from this class), this class presents the elements that are the domain of matching to be of type T as long as the client can provided mappings between objects of type T and CorrelationIdentifiers. Matching can be but may not be commutative. Instead of using left/right terminology it seemed better to talk about this/other as this and other are treated in a slightly asymmetric way. Clients still can implement matchers that impose that a subclass of this class returns the same matches with this and other reversed, however, that behavior is not encoded in this class per se.