public class NoteSubparser extends java.lang.Object implements Subparser, NoteProvider, ChordProvider
| Modifier and Type | Method and Description |
|---|---|
Chord |
createChord(java.lang.String chordString) |
Note |
createNote(java.lang.String noteString) |
double |
getDurationForString(java.lang.String s) |
static NoteSubparser |
getInstance() |
Note |
getMiddleC() |
Token.TokenType |
getTokenType(java.lang.String tokenString)
Asks the subparser to provide a TokenType for the given token.
|
boolean |
matches(java.lang.String music)
Indicates whether the subparser should be responsible for parsing the given music string.
|
int |
parse(java.lang.String s,
StaccatoParserContext context)
Parses the given music string.
|
int |
parseNoteElement(java.lang.String s,
int index,
org.staccato.NoteSubparser.NoteContext noteContext,
StaccatoParserContext parserContext)
Parses a note element.
|
static void |
populateContext(StaccatoParserContext context) |
public static NoteSubparser getInstance()
public boolean matches(java.lang.String music)
Subparserpublic Token.TokenType getTokenType(java.lang.String tokenString)
SubparsergetTokenType in interface SubparsertokenString - The Staccato token to map to a typepublic int parse(java.lang.String s,
StaccatoParserContext context)
Subparserpublic int parseNoteElement(java.lang.String s,
int index,
org.staccato.NoteSubparser.NoteContext noteContext,
StaccatoParserContext parserContext)
s - the token that contains a note elementJFugueException - if there is a problem parsing the elementpublic Note createNote(java.lang.String noteString)
createNote in interface NoteProviderpublic Note getMiddleC()
getMiddleC in interface NoteProviderpublic double getDurationForString(java.lang.String s)
getDurationForString in interface NoteProviderpublic static void populateContext(StaccatoParserContext context)
public Chord createChord(java.lang.String chordString)
createChord in interface ChordProvider