public void readSequence(StringBuffer sequence,DataType dataType,String delimiters,int maxSites,String gapCharacters,String missingCharacters,String matchCharacters,String matchSequence) throws IOException, ImportException {
  char ch=read();
  try {
    int n=0;
    while (n < maxSites && delimiters.indexOf(ch) == -1) {
      if (hasComments && (ch == startComment || ch == lineComment)) {
        skipComments(ch);
        ch=read();
      }
      if (!Character.isWhitespace(ch)) {
        char ch1=ch;
        if (gapCharacters.indexOf(ch) != -1) {
          ch1=DataType.GAP_CHARACTER;
        }
 else         if (missingCharacters.indexOf(ch) != -1) {
          ch1=DataType.UNKNOWN_CHARACTER;
        }
 else         if (matchCharacters.indexOf(ch) != -1) {
          if (matchSequence == null) {
            throw new ImportException("Match character in first sequences");
          }
          if (n >= matchSequence.length()) {
            throw new ImportException("Match sequences too short");
          }
          ch1=matchSequence.charAt(n);
        }
        sequence.append(ch1);
        n++;
      }
      ch=read();
    }
    lastDelimiter=ch;
    if (Character.isWhitespace((char)lastDelimiter)) {
      ch=nextCharacter();
      if (delimiters.indexOf(ch) != -1) {
        lastDelimiter=readCharacter();
      }
    }
  }
 catch (  EOFException e) {
  }
}

public void readSequence ( StringBuffer sequence , DataType dataType , String delimiters , int maxSites , String gapCharacters , String missingCharacters , String matchCharacters , String matchSequence ) throws IOException , ImportException { char ch = read ( ) ; try { int n = 0 ; while ( n < maxSites && delimiters . indexOf ( ch ) == - 1 ) { if ( hasComments && ( ch == startComment || ch == lineComment ) ) { skipComments ( ch ) ; ch = read ( ) ; } if ( ! Character . isWhitespace ( ch ) ) { char ch1 = ch ; if ( gapCharacters . indexOf ( ch ) != - 1 ) { ch1 = DataType . GAP_CHARACTER ; } else if ( missingCharacters . indexOf ( ch ) != - 1 ) { ch1 = DataType . UNKNOWN_CHARACTER ; } else if ( matchCharacters . indexOf ( ch ) != - 1 ) { if ( matchSequence == null ) { throw new ImportException ( "Match character in first sequences" ) ; } if ( n >= matchSequence . length ( ) ) { throw new ImportException ( "Match sequences too short" ) ; } ch1 = matchSequence . charAt ( n ) ; } sequence . append ( ch1 ) ; n ++ ; } ch = read ( ) ; } lastDelimiter = ch ; if ( Character . isWhitespace ( ( char ) lastDelimiter ) ) { ch = nextCharacter ( ) ; if ( delimiters . indexOf ( ch ) != - 1 ) { lastDelimiter = readCharacter ( ) ; } } } catch ( EOFException e ) { } }
reads sequences , skipping over any comments and filtering using datatype .
