|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the primary interface to a Song. Songs are obtained from a SongDatabase. However, Song objects are always "checked-out" copies of the actual Song data. This lets clients manipulate the Song without worry about concurrent access. To commit changes, use the commit method of SongDatabase.
Field Summary | |
static String |
ALTERNATETITLELIST_FIELD
Name of alternate titles field. |
static String |
AUTHOR_FIELD
Name of author field. |
static String |
COMMENT_FIELD
Name of comment field. |
static String |
COPYRIGHT_FIELD
Name of copyright field. |
static String |
KEYWORDLIST_FIELD
Name of keywords field. |
static String |
MAINTITLE_FIELD
Name of main title field. |
static String |
NOTESLIST_FIELD
Name of notes field. |
Method Summary | |
ChordSet |
addChordSet(Locale locale,
Note nativeKeyNote,
UndoableEditListener undoListener)
Add a ChordSet |
Variation |
addVariation(UndoableEditListener undoListener)
Add a Variation |
void |
clear(UndoableEditListener undoListener)
Clear the song body and remove all chord sets, variations, and fields. |
void |
detach()
Detach this song from its database if it is associated with a database. |
int |
getBlockCount()
Get the total number of SongBlocks in the song. |
int |
getBlockCount(Variation variation)
Get the number of SongBlocks present for the given variation. |
SongBlock |
getBlockForSerializableID(String serializableID)
Get a SongBlock given a serializable ID. |
int |
getChordSetCount()
Get the number of ChordSets. |
ChordSet |
getChordSetForSerializableID(String serializableID)
Get a ChordSet given a serializable ID. |
ChordSet |
getDefaultChordSet()
Get default chord set. |
Locale |
getLocale()
Get the locale of the song. |
SongBlock |
getNextBlock(SongBlock reference)
Get the next block following reference. |
SongBlock |
getNextBlock(SongBlock reference,
Variation variation)
Get the next block following reference, in the given variation. |
ChordSet |
getNextChordSet(ChordSet reference)
Get the next chord set following reference. |
Variation |
getNextVariation(Variation reference)
Get the next variation following reference. |
SongBlock |
getNthBlock(int n)
Get the nth SongBlock |
SongBlock |
getNthBlock(int n,
Variation variation)
Get the nth SongBlock in the given variation. |
ChordSet |
getNthChordSet(int n)
Get the nth ChordSet |
Variation |
getNthVariation(int n)
Get the nth Variation |
SongBlock |
getPreviousBlock(SongBlock reference)
Get the previous block preceding reference. |
SongBlock |
getPreviousBlock(SongBlock reference,
Variation variation)
Get the previous block preceding reference, in the given variation. |
ChordSet |
getPreviousChordSet(ChordSet reference)
Get the previous chord set preceding reference. |
Variation |
getPreviousVariation(Variation reference)
Get the previous variation preceding reference. |
SongID |
getSongID()
Get the id used to check out the song from its database. |
int |
getVariationCount()
Get the number of Variations. |
Variation |
getVariationForSerializableID(String serializableID)
Get a Variation given a serializable ID. |
SongBlock |
insertBlockAfter(SongBlock after,
Variation variation,
UndoableEditListener undoListener)
Add a SongBlock at the given position in the given variation. |
SongBlock |
insertBlockBefore(SongBlock before,
Variation variation,
UndoableEditListener undoListener)
Add a SongBlock at the given position in the given variation. |
void |
removeBlock(SongBlock block,
UndoableEditListener undoListener)
Remove the given SongBlock. |
void |
removeChordSet(ChordSet cs,
UndoableEditListener undoListener)
Remove a ChordSet. |
void |
removeVariation(Variation variation,
UndoableEditListener undoListener)
Remove a Variation. |
void |
setDefaultChordSet(ChordSet cs,
UndoableEditListener undoListener)
Set a ChordSet as the default. |
Methods inherited from interface com.virtuosotechnologies.asaph.model.FieldContainer |
addBinaryField, addBinaryListField, addStringField, addStringListField, getFieldCount, getNamedField, getNextField, getNthField, getPreviousField, removeField |
Field Detail |
public static final String MAINTITLE_FIELD
public static final String COMMENT_FIELD
public static final String ALTERNATETITLELIST_FIELD
public static final String AUTHOR_FIELD
public static final String COPYRIGHT_FIELD
public static final String KEYWORDLIST_FIELD
public static final String NOTESLIST_FIELD
Method Detail |
public SongID getSongID()
public Locale getLocale()
public int getChordSetCount()
public ChordSet getNthChordSet(int n)
n
- index
public ChordSet getNextChordSet(ChordSet reference)
reference
- reference ChordSet
IllegalArgumentException
- reference is not a memberpublic ChordSet getPreviousChordSet(ChordSet reference)
reference
- reference ChordSet
IllegalArgumentException
- reference is not a memberpublic ChordSet getDefaultChordSet()
public ChordSet getChordSetForSerializableID(String serializableID)
serializableID
- serializable ID string
public int getVariationCount()
public Variation getNthVariation(int n)
n
- index
public Variation getNextVariation(Variation reference)
reference
- reference Variation
IllegalArgumentException
- reference is not a memberpublic Variation getPreviousVariation(Variation reference)
reference
- reference Variation
IllegalArgumentException
- reference is not a memberpublic Variation getVariationForSerializableID(String serializableID)
serializableID
- serializable ID string
public int getBlockCount()
public SongBlock getNthBlock(int n)
n
- index
public SongBlock getNextBlock(SongBlock reference)
reference
- reference SongBlock
IllegalArgumentException
- reference is not a memberpublic SongBlock getPreviousBlock(SongBlock reference)
reference
- reference SongBlock
IllegalArgumentException
- reference is not a memberpublic int getBlockCount(Variation variation)
variation
- Variation to query, or null for the default variation
IllegalArgumentException
- variation is not a memberpublic SongBlock getNthBlock(int n, Variation variation)
n
- indexvariation
- Variation to query, or null for the default variation
public SongBlock getNextBlock(SongBlock reference, Variation variation)
reference
- reference SongBlockvariation
- Variation to query, or null for the default variation
IllegalArgumentException
- variation or reference is not a memberpublic SongBlock getPreviousBlock(SongBlock reference, Variation variation)
reference
- reference SongBlockvariation
- Variation to query, or null for the default variation
IllegalArgumentException
- variation or reference is not a memberpublic SongBlock getBlockForSerializableID(String serializableID)
serializableID
- serializable ID string
public void clear(UndoableEditListener undoListener)
undoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable editspublic void detach()
public ChordSet addChordSet(Locale locale, Note nativeKeyNote, UndoableEditListener undoListener)
locale
- Locale for the ChordSet, or null to use the Song's default.nativeKeyNote
- native key NoteundoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException
- keyType or nativeKeyNode was nullpublic void removeChordSet(ChordSet cs, UndoableEditListener undoListener)
cs
- ChordSetundoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
IllegalArgumentException
- cs is not present
NullPointerException
- cs was nullpublic void setDefaultChordSet(ChordSet cs, UndoableEditListener undoListener)
cs
- ChordSet to set as the default.undoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
IllegalArgumentException
- cs is not a member of this songpublic Variation addVariation(UndoableEditListener undoListener)
undoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
public void removeVariation(Variation variation, UndoableEditListener undoListener)
variation
- VariationundoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
IllegalArgumentException
- variation is not present
NullPointerException
- variation was nullpublic SongBlock insertBlockBefore(SongBlock before, Variation variation, UndoableEditListener undoListener)
before
- insert before this block, or at the end if nullvariation
- Variation to add to, or null to add to all variations.undoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
IllegalArgumentException
- before or variation is not a memberpublic SongBlock insertBlockAfter(SongBlock after, Variation variation, UndoableEditListener undoListener)
after
- insert after this block, or at the beginning if nullvariation
- Variation to add to, or null to add to all variations.undoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
IllegalArgumentException
- after or variation is not a memberpublic void removeBlock(SongBlock block, UndoableEditListener undoListener)
block
- block to removeundoListener
- listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
IllegalArgumentException
- block is not present
NullPointerException
- block was null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |