abc4j API Specification

abc.parser
Class AbcFileParser

java.lang.Object
  extended by abc.parser.AbcParserAbstract
      extended by abc.parser.AbcFileParser
Direct Known Subclasses:
AbcHeadersParser

public class AbcFileParser
extends AbcParserAbstract

This class provides instances to parse files and streams using abc notation. Parser instances from this class will parse the whole content of the input files / streams (headers + music). If you are only interested in getting tune headers, you'd better use the AbcHeadersParser that will restrict the parsing to abc headers. Such parsing is faster than parsing the whole content of the file (about 10x from what I've been able to measure...).

See Also:
AbcHeadersParser

Constructor Summary
AbcFileParser()
          Creates a new abc file parser.
 
Method Summary
 void addListener(AbcFileParserListenerInterface listener)
          Adds a listener to catch events thrwon by the parser durin tune parsing.
 void parseFile(java.io.File abcFile)
          Parses the specified file.
 void parseFile(java.io.Reader abcCharStream)
          Parses the specified stream in abc notation.
 void parseFileHeaders(java.io.BufferedReader charStream)
          Deprecated.  
 void parseFileHeaders(java.io.File abcFile)
          Deprecated.  
 void removeListener(AbcFileParserListenerInterface listener)
          Removes a listener from this parser.
 
Methods inherited from class abc.parser.AbcParserAbstract
addListener, getScanner, removeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbcFileParser

public AbcFileParser()
Creates a new abc file parser.

Method Detail

addListener

public void addListener(AbcFileParserListenerInterface listener)
Adds a listener to catch events thrwon by the parser durin tune parsing.

Parameters:
listener - Object that implements the TuneParserListenerInterface.
See Also:
removeListener(abc.parser.AbcFileParserListenerInterface)

removeListener

public void removeListener(AbcFileParserListenerInterface listener)
Removes a listener from this parser.

Parameters:
listener - The listener to be removed.
See Also:
addListener(abc.parser.AbcFileParserListenerInterface)

parseFile

public void parseFile(java.io.File abcFile)
               throws java.io.FileNotFoundException
Parses the specified file.

Parameters:
abcFile - The file to be parsed.
Throws:
java.io.FileNotFoundException - Thrown if the specified file isn't found.

parseFile

public void parseFile(java.io.Reader abcCharStream)
Parses the specified stream in abc notation.

Parameters:
abcCharStream - The abc stream to be parsed.

parseFileHeaders

public void parseFileHeaders(java.io.File abcFile)
                      throws java.io.FileNotFoundException
Deprecated. 

Parses only tunes header of the the specified file.

Parameters:
abcFile - A text file using ABC notation.
Throws:
java.io.FileNotFoundException - Thrown if the specified file isn't found.

parseFileHeaders

public void parseFileHeaders(java.io.BufferedReader charStream)
Deprecated. 


abc4j API Specification

Submit a bug or feature