Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.virtuosotechnologies.asaph.model
Interface Song  view Song download Song.java


public interface Song

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 java.lang.String ALTERNATETITLELIST_FIELD
          Name of alternate titles field.
static java.lang.String AUTHOR_FIELD
          Name of author field.
static java.lang.String COMMENT_FIELD
          Name of comment field.
static java.lang.String COPYRIGHT_FIELD
          Name of copyright field.
static java.lang.String KEYWORDLIST_FIELD
          Name of keywords field.
static java.lang.String MAINTITLE_FIELD
          Name of main title field.
static java.lang.String NOTESLIST_FIELD
          Name of notes field.
 
Method Summary
 ChordSet addChordSet(java.lang.String keyType, com.virtuosotechnologies.asaph.model.notation.Note nativeKeyNote, javax.swing.event.UndoableEditListener undoListener)
          Add a ChordSet
 StringField addStringField(java.lang.String name, java.lang.String str, javax.swing.event.UndoableEditListener undoListener)
          Add a string field.
 StringListField addStringListField(java.lang.String name, javax.swing.event.UndoableEditListener undoListener)
          Add a string list field.
 Variation addVariation(javax.swing.event.UndoableEditListener undoListener)
          Add a Variation
 void clear(javax.swing.event.UndoableEditListener undoListener)
          Clear the song body, removes all titles, keywords, chord sets, fields and notes, and clears the credits and copyright.
 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(java.lang.String serializableID)
          Get a SongBlock given a serializable ID.
 int getChordSetCount()
          Get the number of ChordSets.
 ChordSet getChordSetForSerializableID(java.lang.String serializableID)
          Get a ChordSet given a serializable ID.
 ChordSet getDefaultChordSet()
          Get default chord set.
 int getFieldCount()
          Get the number of fields.
 java.util.Locale getLocale()
          Get the locale of the song.
 Field getNamedField(java.lang.String name)
          Search for the field with the given name.
 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.
 Field getNextField(Field reference)
          Get the next field 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
 Field getNthField(int n)
          Get the nth field
 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.
 Field getPreviousField(Field reference)
          Get the previous field 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(java.lang.String serializableID)
          Get a Variation given a serializable ID.
 SongBlock insertBlockAfter(SongBlock after, Variation variation, javax.swing.event.UndoableEditListener undoListener)
          Add a SongBlock at the given position in the given variation.
 SongBlock insertBlockBefore(SongBlock before, Variation variation, javax.swing.event.UndoableEditListener undoListener)
          Add a SongBlock at the given position in the given variation.
 void removeBlock(SongBlock block, javax.swing.event.UndoableEditListener undoListener)
          Remove the given SongBlock.
 void removeChordSet(ChordSet cs, javax.swing.event.UndoableEditListener undoListener)
          Remove a ChordSet.
 void removeField(Field field, javax.swing.event.UndoableEditListener undoListener)
          Remove a Field.
 void removeVariation(Variation variation, javax.swing.event.UndoableEditListener undoListener)
          Remove a Variation.
 void setDefaultChordSet(ChordSet cs, javax.swing.event.UndoableEditListener undoListener)
          Set a ChordSet as the default.
 

Field Detail

MAINTITLE_FIELD

public static final java.lang.String MAINTITLE_FIELD
Name of main title field. Value is a StringField.

See Also:
Constant Field Values

COMMENT_FIELD

public static final java.lang.String COMMENT_FIELD
Name of comment field. Value is a StringField.

See Also:
Constant Field Values

ALTERNATETITLELIST_FIELD

public static final java.lang.String ALTERNATETITLELIST_FIELD
Name of alternate titles field. Value is a StringListField.

See Also:
Constant Field Values

AUTHOR_FIELD

public static final java.lang.String AUTHOR_FIELD
Name of author field. Value is a StringField.

See Also:
Constant Field Values

COPYRIGHT_FIELD

public static final java.lang.String COPYRIGHT_FIELD
Name of copyright field. Value is a StringField.

See Also:
Constant Field Values

KEYWORDLIST_FIELD

public static final java.lang.String KEYWORDLIST_FIELD
Name of keywords field. Value is a StringListField.

See Also:
Constant Field Values

NOTESLIST_FIELD

public static final java.lang.String NOTESLIST_FIELD
Name of notes field. Value is a StringListField.

See Also:
Constant Field Values
Method Detail

getSongID

public SongID getSongID()
Get the id used to check out the song from its database. Returns null if this song is not associated with a database.


getLocale

public java.util.Locale getLocale()
Get the locale of the song.


getChordSetCount

public int getChordSetCount()
Get the number of ChordSets.


getNthChordSet

public ChordSet getNthChordSet(int n)
Get the nth ChordSet


getNextChordSet

public ChordSet getNextChordSet(ChordSet reference)
Get the next chord set following reference. If reference is null, returns the first chord set. If reference is the last chord set, returns null;


getPreviousChordSet

public ChordSet getPreviousChordSet(ChordSet reference)
Get the previous chord set preceding reference. If reference is null, returns the last chord set. If reference is the first chord set, returns null;


getDefaultChordSet

public ChordSet getDefaultChordSet()
Get default chord set. Returns null if there is no default.


getChordSetForSerializableID

public ChordSet getChordSetForSerializableID(java.lang.String serializableID)
Get a ChordSet given a serializable ID. Returns null if there is no ChordSet with the given ID.


getVariationCount

public int getVariationCount()
Get the number of Variations.


getNthVariation

public Variation getNthVariation(int n)
Get the nth Variation


getNextVariation

public Variation getNextVariation(Variation reference)
Get the next variation following reference. If reference is null, returns the first variation. If reference is the last variation, returns null;


getPreviousVariation

public Variation getPreviousVariation(Variation reference)
Get the previous variation preceding reference. If reference is null, returns the last variation. If reference is the first variation, returns null;


getVariationForSerializableID

public Variation getVariationForSerializableID(java.lang.String serializableID)
Get a Variation given a serializable ID. Returns null if there is no Variation with the given ID.


getBlockCount

public int getBlockCount()
Get the total number of SongBlocks in the song. This list may not correspond to any particular variation of the song.


getNthBlock

public SongBlock getNthBlock(int n)
Get the nth SongBlock


getNextBlock

public SongBlock getNextBlock(SongBlock reference)
Get the next block following reference. If reference is null, returns the first block. If reference is the last block, returns null;


getPreviousBlock

public SongBlock getPreviousBlock(SongBlock reference)
Get the previous block preceding reference. If reference is null, returns the last block. If reference is the first block, returns null;


getBlockCount

public int getBlockCount(Variation variation)
Get the number of SongBlocks present for the given variation. Pass null to specify the default variation.


getNthBlock

public SongBlock getNthBlock(int n,
                             Variation variation)
Get the nth SongBlock in the given variation. Pass null to specify the default variation


getNextBlock

public SongBlock getNextBlock(SongBlock reference,
                              Variation variation)
Get the next block following reference, in the given variation. If reference is null, returns the first block. If reference is the last block, returns null; It is legal for reference to not be a member of the given variation. In such a case, the method will return the next block that is part of this variation.


getPreviousBlock

public SongBlock getPreviousBlock(SongBlock reference,
                                  Variation variation)
Get the previous block preceding reference, in the given variation. If reference is null, returns the last block. If reference is the first block, returns null; It is legal for reference to not be a member of the given variation. In such a case, the method will return the previous block that is part of this variation.


getBlockForSerializableID

public SongBlock getBlockForSerializableID(java.lang.String serializableID)
Get a SongBlock given a serializable ID. Returns null if there is no SongBlock with the given ID.


getFieldCount

public int getFieldCount()
Get the number of fields.


getNthField

public Field getNthField(int n)
Get the nth field


getNextField

public Field getNextField(Field reference)
Get the next field following reference. If reference is null, returns the first field. If reference is the last field, returns null;


getPreviousField

public Field getPreviousField(Field reference)
Get the previous field preceding reference. If reference is null, returns the last field. If reference is the first field, returns null;


getNamedField

public Field getNamedField(java.lang.String name)
Search for the field with the given name. Returns null if there is no such field. Implementations of this method may be faster than doing a linear search with getNextField.


clear

public void clear(javax.swing.event.UndoableEditListener undoListener)
Clear the song body, removes all titles, keywords, chord sets, fields and notes, and clears the credits and copyright.


addChordSet

public ChordSet addChordSet(java.lang.String keyType,
                            com.virtuosotechnologies.asaph.model.notation.Note nativeKeyNote,
                            javax.swing.event.UndoableEditListener undoListener)
Add a ChordSet


removeChordSet

public void removeChordSet(ChordSet cs,
                           javax.swing.event.UndoableEditListener undoListener)
Remove a ChordSet.


setDefaultChordSet

public void setDefaultChordSet(ChordSet cs,
                               javax.swing.event.UndoableEditListener undoListener)
Set a ChordSet as the default. The ChordSet given must be a member of this song. You may pass null, which sets no default.


addVariation

public Variation addVariation(javax.swing.event.UndoableEditListener undoListener)
Add a Variation


removeVariation

public void removeVariation(Variation variation,
                            javax.swing.event.UndoableEditListener undoListener)
Remove a Variation.


insertBlockBefore

public SongBlock insertBlockBefore(SongBlock before,
                                   Variation variation,
                                   javax.swing.event.UndoableEditListener undoListener)
Add a SongBlock at the given position in the given variation. If variation is null, the block added is a StandardSongBlock and is added to the default song (thus, it is added to all variations.) Otherwise, an AddedSongBlock is added to the given variation.


insertBlockAfter

public SongBlock insertBlockAfter(SongBlock after,
                                  Variation variation,
                                  javax.swing.event.UndoableEditListener undoListener)
Add a SongBlock at the given position in the given variation. If variation is null, the block added is a StandardSongBlock and is added to the default song (thus, it is added to all variations.) Otherwise, an AddedSongBlock is added to the given variation.


removeBlock

public void removeBlock(SongBlock block,
                        javax.swing.event.UndoableEditListener undoListener)
Remove the given SongBlock.


addStringField

public StringField addStringField(java.lang.String name,
                                  java.lang.String str,
                                  javax.swing.event.UndoableEditListener undoListener)
Add a string field. If a string field with the given name is already present, sets the value of the field and returns it. If a field of a different type is already present with the given name, replaces it with a new string field.


addStringListField

public StringListField addStringListField(java.lang.String name,
                                          javax.swing.event.UndoableEditListener undoListener)
Add a string list field. If a string list field with the given name is already present, returns the existing field and doesn't modify it. If a field of a different type is already present with the given name, replaces it with a new string list field.


removeField

public void removeField(Field field,
                        javax.swing.event.UndoableEditListener undoListener)
Remove a Field.