Constructor and Description |
---|
MatrixCosts(double[][] matrix,
double gap)
Creates a new instance of
MatrixCosts where the costs
for mismatch and match are given in matrix . |
MatrixCosts(StringBuffer xml)
Restores
MatrixCosts object from its XML representation. |
Modifier and Type | Method and Description |
---|---|
double |
getCostFor(Sequence s1,
Sequence s2,
int i,
int j)
Returns the costs for the alignment of
s1(i) and
s2(j) . |
double |
getGapCosts()
Returns the costs for a gap.
|
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public MatrixCosts(double[][] matrix, double gap) throws CloneNotSupportedException
MatrixCosts
where the costs
for mismatch and match are given in matrix
.
Additionally, the costs for a gap can be specified.matrix
- the match and mismatch costsgap
- the cost for a gapCloneNotSupportedException
- if matrix
could not be clonedpublic MatrixCosts(StringBuffer xml) throws NonParsableException
MatrixCosts
object from its XML representation.xml
- the XML representationNonParsableException
- if the XML could not be parsedpublic StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.public double getCostFor(Sequence s1, Sequence s2, int i, int j)
Costs
s1(i)
and
s2(j)
.getCostFor
in interface Costs
s1
- the first sequences2
- the second sequencei
- the index in the first sequencej
- the index in the second sequenceSequence.discreteVal(int)
public double getGapCosts()
Costs
getGapCosts
in interface Costs