|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectabc.parser.TuneBook
This class provides an object representation of a tunebook. It enables you to store tunes ordered by reference number.
Constructor Summary | |
TuneBook()
Creates an empty tunebook. |
|
TuneBook(java.io.BufferedReader stream)
Creates a new tune book from the specified stream. |
|
TuneBook(java.io.BufferedReader stream,
AbcFileParserListenerInterface listener)
|
|
TuneBook(java.io.File abcFile)
Creates a new tune book from the specified file. |
|
TuneBook(java.io.File abcFile,
AbcFileParserListenerInterface listener)
|
Method Summary | |
void |
addListener(TuneBookListenerInterface l)
Adds a listener to this tunebook to be aware of tunes changes. |
java.io.File |
getFile()
|
int |
getHighestReferenceNumber()
|
int[] |
getReferenceNumbers()
Returns the reference numbers of tunes contained in this tunebook. |
Tune |
getTune(int referenceNumber)
Returns the tune with the specified reference number |
java.lang.String |
getTuneHeader(int referenceNumber)
|
java.lang.String |
getTuneNotation(int referenceNumber)
Returns the notation of the tune corresponding to the specified reference number. |
Tune[] |
getTunesHeaders()
Returns tunes header information of tunes contained in this tunebook. |
Tune |
putTune(java.lang.String tuneNotation)
Puts the specified notation in this tunebook. |
void |
removeListener(TuneBookListenerInterface l)
Removes a listener from this tunebook. |
Tune |
removeTune(int referenceNumber)
Removes the tune with specified reference number. |
void |
save()
|
void |
saveTo(java.io.File file)
Saves this tunebook to the specified file. |
int |
size()
Returns the number of tunes contained in this tunebook. |
java.util.Vector |
toVector()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TuneBook(java.io.File abcFile) throws java.io.FileNotFoundException
abcFile
- The file that contains tunes in abc notation.
java.io.FileNotFoundException
- Thrown if the specified file doesn't exist.public TuneBook(java.io.File abcFile, AbcFileParserListenerInterface listener) throws java.io.FileNotFoundException
public TuneBook(java.io.BufferedReader stream)
stream
- The stream in abc notation.public TuneBook(java.io.BufferedReader stream, AbcFileParserListenerInterface listener)
public TuneBook()
Method Detail |
public void saveTo(java.io.File file) throws java.io.IOException
file
- The file where all tunes notation should be stored.
java.io.IOException
- Thrown if the specified file doesn't exist.public java.io.File getFile()
public void save() throws java.io.IOException
java.io.IOException
public Tune putTune(java.lang.String tuneNotation)
tuneNotation
- A string that describes a tune using ABC notation.
public Tune removeTune(int referenceNumber)
referenceNumber
- The reference number of the tune that has to be
removed.
public Tune getTune(int referenceNumber)
referenceNumber
- The reference number of the tune that should be retrieved.
public java.lang.String getTuneHeader(int referenceNumber)
public java.lang.String getTuneNotation(int referenceNumber) throws NoSuchTuneException
referenceNumber
- A reference number.
NoSuchTuneException
- Thrown if the specified reference number
doesn't exist in this tunebook.public Tune[] getTunesHeaders()
public int[] getReferenceNumbers()
public int getHighestReferenceNumber()
public int size()
public java.util.Vector toVector()
public void addListener(TuneBookListenerInterface l)
l
- The listener to be added.public void removeListener(TuneBookListenerInterface l)
l
- The listener to be removed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |