Package org.staccato
Class NoteSubparser
java.lang.Object
org.staccato.NoteSubparser
- All Implemented Interfaces:
ChordProvider
,NoteProvider
,Subparser
-
Method Summary
Modifier and TypeMethodDescriptioncreateChord
(String chordString) createNote
(String noteString) double
static NoteSubparser
getTokenType
(String tokenString) Asks the subparser to provide a TokenType for the given token.boolean
Indicates whether the subparser should be responsible for parsing the given music string.int
parse
(String s, StaccatoParserContext context) Parses the given music string.int
parseNoteElement
(String s, int index, org.staccato.NoteSubparser.NoteContext noteContext, StaccatoParserContext parserContext) Parses a note element.static void
populateContext
(StaccatoParserContext context)
-
Method Details
-
getInstance
-
matches
Description copied from interface:Subparser
Indicates whether the subparser should be responsible for parsing the given music string. -
getTokenType
Description copied from interface:Subparser
Asks the subparser to provide a TokenType for the given token.- Specified by:
getTokenType
in interfaceSubparser
- Parameters:
tokenString
- The Staccato token to map to a type
-
parse
Description copied from interface:Subparser
Parses 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:
createNote
in interfaceNoteProvider
-
getMiddleC
- Specified by:
getMiddleC
in interfaceNoteProvider
-
getDurationForString
- Specified by:
getDurationForString
in interfaceNoteProvider
-
populateContext
-
createChord
- Specified by:
createChord
in interfaceChordProvider
-