Example #1
0
 /**
  * Returns the String of the next sub-token (the parts after + or _), if one exists; otherwise,
  * returns null
  */
 private int parseConnector(String s, int index, NoteContext context) {
   context.thereIsAnother = false;
   // See if there's another note to process
   if ((index < s.length()) && ((s.charAt(index) == '+') || (s.charAt(index) == '_'))) {
     logger.info("Another note: string = " + s.substring(index, s.length() - 1));
     if (s.charAt(index) == '_') {
       context.anotherNoteIsMelodic = true;
       logger.info("Next note will be melodic");
     } else {
       context.anotherNoteIsHarmonic = true;
       logger.info("Next note will be harmonic");
     }
     index++;
     context.thereIsAnother = true;
   }
   return index;
 }