org.jfugue
Class Parser

java.lang.Object
  extended by org.jfugue.Parser
Direct Known Subclasses:
MidiParser, MusicStringParser, MusicXmlParser

public class Parser
extends java.lang.Object

You may notice that there is no parse() method in the Parser class! That's because the parse() method may take any type of parameter, as well as any number of parameters, so it isn't something that can declared ahead of time.

Author:
David Koelle

Field Summary
static int TRACING_OFF
          Pass this value to setTracing( ) to turn tracing off.
static int TRACING_ON
          Pass this value to setTracing( ) to turn tracing on.
 
Constructor Summary
Parser()
           
 
Method Summary
 void addParserListener(ParserListener l)
          Adds a ParserListener.
 void addParserProgressListener(ParserProgressListener l)
          Adds a ParserListener.
 int getTracing()
          Returns the current state of tracing.
 void removeParserListener(ParserListener l)
          Removes a ParserListener.
 void removeParserProgressListener(ParserProgressListener l)
          Removes a ParserListener.
 void setTracing(int tracing)
          Turns tracing on or off.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACING_OFF

public static final int TRACING_OFF
Pass this value to setTracing( ) to turn tracing off. Tracing is off by default.

See Also:
Constant Field Values

TRACING_ON

public static final int TRACING_ON
Pass this value to setTracing( ) to turn tracing on. Tracing is off by default.

See Also:
Constant Field Values
Constructor Detail

Parser

public Parser()
Method Detail

setTracing

public void setTracing(int tracing)
Turns tracing on or off. If you're having trouble with your music string, or if you've added new tokens to the parser, turn tracing on to make sure that your new tokens are parsed correctly.

Parameters:
tracing - the state of tracing - on or off

getTracing

public int getTracing()
Returns the current state of tracing.

Returns:
the state of tracing

addParserProgressListener

public void addParserProgressListener(ParserProgressListener l)
Adds a ParserListener. The listener will receive events when the parser interprets music string tokens.

Parameters:
listener - the listener that is to be notified of parser events

removeParserProgressListener

public void removeParserProgressListener(ParserProgressListener l)
Removes a ParserListener.

Parameters:
listener - the listener to remove

addParserListener

public void addParserListener(ParserListener l)
Adds a ParserListener. The listener will receive events when the parser interprets music string tokens.

Parameters:
listener - the listener that is to be notified of parser events

removeParserListener

public void removeParserListener(ParserListener l)
Removes a ParserListener.

Parameters:
listener - the listener to remove