T
- The type of the elements that are being aligned.public class AlignmentPricer<T>
extends java.lang.Object
SequenceAlignment
).Constructor and Description |
---|
AlignmentPricer(java.util.function.ToIntBiFunction<T,T> alignmentCostFunction,
java.util.function.ToIntFunction<T> gapCostFunction)
Constructs a new
AlignmentPricer . |
Modifier and Type | Method and Description |
---|---|
int |
alignmentCost(T item1,
T item2)
Calculate the cost of aligning
item1 with item2 . |
public AlignmentPricer(java.util.function.ToIntBiFunction<T,T> alignmentCostFunction, java.util.function.ToIntFunction<T> gapCostFunction)
AlignmentPricer
.alignmentCostFunction
- A function that specifies the cost of aligning a T
with some other T
(e.g., based on the values of the properties of the two instances).gapCostFunction
- A function that specifies the cost of aligning a T
with a gap. Note that the
function is free to specify different gap costs for different T
s.public int alignmentCost(T item1, T item2)
item1
with item2
. If either of the two arguments is set to
null
, the cost of aligning the other argument with a gap will be returned. Note that both arguments
cannot be null
at the same time as that translates to aligning a gap with a gap, which is pointless.item1
- The first of the two aligned objects. Set to null
to calculate the cost of aligning
item2
with a gap.item2
- The second of the two aligned objects. Set to null
to calculate the cost of aligning
item2
with a gap.item1
with item2
.