V
- the class that is represented by the corresponding Value of this ValueComparator.public abstract class AbstractValueComparatorWrapper<V> extends Object implements ValueComparator
Constructor and Description |
---|
AbstractValueComparatorWrapper(String keyword,
ValueType type,
Comparator<V,V> actualComparator) |
Modifier and Type | Method and Description |
---|---|
double |
compare(OperationType type,
Node a,
Node b)
This method returns a dissimilarity between x and y using the alignment operation op with the
following restrictions:
compare(op,x,y) ≥ 0 (non-negativity)
compare(op,x,y) ≤ 1 (normalization)
x = y ⇒ compare(op,x,y) = 0 (equality)
Further, this function guarantees consistency with respect to null inputs, that is, for any
operation op ∈ {REPLACEMENT, DELETIONREPLACEMENT, INSERTIONREPLACEMENT} it holds:
d(op, x, null) = d(DELETION, x, null)
d(op, null, y) = d(INSERTION, null, y)
and for any operation it holds:
d(op, null, null) = 0
Please note that a and b might be null if this alignment uses gaps or
skips.
|
V |
extractValue(Node node) |
String |
getKeyword()
Returns the keyword for which values are compared by this ValueComparator.
|
ValueType |
getType()
Returns the ValueType this comparator operates on.
|
boolean |
hasCoherentReplacementCost()
This method should return true if and only if this Comparator guarantees that
compare(OperationType.REPLACEMENT, x, y) =
compare(OperationType.DELETIONREPLACEMENT, x, y) =
compare(OperationType.INSERTIONREPLACEMENT, x, y)
for all possible inputs x, y.
|
boolean |
supports(OperationType type)
This method should return true if and only if this Comparator supports the given alignment
operation.
|
public AbstractValueComparatorWrapper(String keyword, ValueType type, Comparator<V,V> actualComparator)
public String getKeyword()
ValueComparator
getKeyword
in interface ValueComparator
public ValueType getType()
ValueComparator
getType
in interface ValueComparator
public double compare(@NonNull OperationType type, Node a, Node b)
Comparator
compare
in interface Comparator<Node,Node>
type
- the type of alignment operation to be used.a
- the left input.b
- the right input.public boolean hasCoherentReplacementCost()
Comparator
hasCoherentReplacementCost
in interface Comparator<Node,Node>
public boolean supports(OperationType type)
Comparator
supports
in interface Comparator<Node,Node>
type
- an alignment OperationType.Copyright (C) 2016-2018 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/