To solve issue 312 and 457, I add a validation of invalid characters
getInvalidChar(String sequence, DataType dataType) in SimpleAlignment.
It searches invalid characters in the sequence by given data type, and
returns its index in the sequence string, if no invalid character,
then return -1.
To get valid chars by given a certain data type, I create an abstract
method char[] getValidChars() in DataType, which returns the set of
valid chars if they are defined, or return null if not defined. We
cannot use stateCount to loop, because some data types stateCount is
changed by data.
Every child class of DataType needs to implement getValidChars() now,
if you do not want to be validated, then just return null. Otherwise,
return the char[], like classes Nucleotides, AminoAcids, and TwoStates
currently.
Thanks,
Walter