示例#1
0
  private boolean isRnaSequence() {
    char[] sequenceArray = sequence.getValue().toCharArray();
    boolean isRNA = sequenceArray.length > 0; // true if length is longer than 0

    if (isRNA) {
      for (char c : sequenceArray) {
        if (!(isRNA = isRNABase(c))) break;
      }
    }

    return isRNA;
  }
示例#2
0
  private boolean isMatchingDotBracket() {
    //        if(sequence == null || dotBracket == null) { return false; }
    //        if(sequence.get().length() != dotBracket.get().length()) {return false;}
    int openBrackets = 0;

    for (char c : dotBracket.getValue().toCharArray()) {
      switch (c) {
        case '(':
          openBrackets++;
          break;
        case ')':
          openBrackets--;
          break;
        default:
          break;
      }
    }

    return (openBrackets == 0);
  }