Class NoteSubparser
java.lang.Object
org.staccato.NoteSubparser
- All Implemented Interfaces:
ChordProvider, NoteProvider, Subparser
-
Method Summary
Modifier and TypeMethodDescriptioncreateChord(String chordString) createNote(String noteString) doublestatic NoteSubparsergetTokenType(String tokenString) Asks the subparser to provide a TokenType for the given token.booleanIndicates whether the subparser should be responsible for parsing the given music string.intparse(String s, StaccatoParserContext context) Parses the given music string.intparseNoteElement(String s, int index, org.staccato.NoteSubparser.NoteContext noteContext, StaccatoParserContext parserContext) Parses a note element.static voidpopulateContext(StaccatoParserContext context)
-
Method Details
-
getInstance
-
matches
Description copied from interface:SubparserIndicates whether the subparser should be responsible for parsing the given music string. -
getTokenType
Description copied from interface:SubparserAsks the subparser to provide a TokenType for the given token.- Specified by:
getTokenTypein interfaceSubparser- Parameters:
tokenString- The Staccato token to map to a type
-
parse
Description copied from interface:SubparserParses the given music string. -
parseNoteElement
public int parseNoteElement(String s, int index, org.staccato.NoteSubparser.NoteContext noteContext, StaccatoParserContext parserContext) Parses a note element.- Parameters:
s- the token that contains a note element
-
createNote
- Specified by:
createNotein interfaceNoteProvider
-
getMiddleC
- Specified by:
getMiddleCin interfaceNoteProvider
-
getDurationForString
- Specified by:
getDurationForStringin interfaceNoteProvider
-
populateContext
-
createChord
- Specified by:
createChordin interfaceChordProvider
-