net.charlesames.music.musicxml
Class MusicXmlScore

java.lang.Object
  extended by net.charlesames.utility.common.Disposable
      extended by net.charlesames.music.musicxml.MusicXmlEntity
          extended by net.charlesames.music.musicxml.MusicXmlScore
Direct Known Subclasses:
ScorePartwise

public abstract class MusicXmlScore
extends MusicXmlEntity

The MusicXmlScore class implements functionality shared between the MusicXML <score-partwise> and <score-timewise> elements.

Author:
Charles Ames

Method Summary
 void addCredit(Credit credit)
          Add a credit.
abstract  org.w3c.dom.DocumentType createDocumentType()
          Create an XML DocumentType.
 boolean equals(MusicXmlEntity other)
          Test if this MusicXML entity has the same content as another object.
 java.util.List<Credit> getCredits()
          Get all <@link Credit> instances.
 java.lang.String getVersion()
          Getter for the Version property.
 boolean isDirty()
          Test if the document has experienced a change which should be saved to the MusicXML file.
static MusicXmlScore load(java.io.File file)
          Load a MusicXML document.
 void makeDirty()
          Signal that the document has experienced a change which should be saved to the MusicXML file.
 void putXmlData(org.w3c.dom.Element element)
           
 void save(java.io.File file)
          Save a MusicXML document.
 org.w3c.dom.Node toXmlNode(org.w3c.dom.Node parent)
          Serialize the content of a MusicXML entity into an XML element.
 
Methods inherited from class net.charlesames.music.musicxml.MusicXmlEntity
getContainer
 
Methods inherited from class net.charlesames.utility.common.Disposable
dispose
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getVersion

public java.lang.String getVersion()
Getter for the Version property.

Returns:
The Version value.

getCredits

public java.util.List<Credit> getCredits()
Get all <@link Credit> instances.

Returns:
An unsorted collection of <@link Credit> instances.

addCredit

public void addCredit(Credit credit)
Add a credit.

Parameters:
credit - The credit.

putXmlData

public void putXmlData(org.w3c.dom.Element element)

createDocumentType

public abstract org.w3c.dom.DocumentType createDocumentType()
Create an XML DocumentType.

Returns:
An XML DocumentType

load

public static MusicXmlScore load(java.io.File file)
Load a MusicXML document.

Parameters:
file - The input file
Returns:
A MusicXmlScore instance.

toXmlNode

public org.w3c.dom.Node toXmlNode(org.w3c.dom.Node parent)
Description copied from class: MusicXmlEntity
Serialize the content of a MusicXML entity into an XML element.

Specified by:
toXmlNode in class MusicXmlEntity
Parameters:
parent - The XML element which is to receive the data.
Returns:
The newly created XML element.

isDirty

public boolean isDirty()
Test if the document has experienced a change which should be saved to the MusicXML file.

Returns:
True if a change has occured; false otherwise.

makeDirty

public void makeDirty()
Description copied from class: MusicXmlEntity
Signal that the document has experienced a change which should be saved to the MusicXML file.

Overrides:
makeDirty in class MusicXmlEntity

save

public void save(java.io.File file)
Save a MusicXML document.

Parameters:
file - The output file.

equals

public boolean equals(MusicXmlEntity other)
Description copied from class: MusicXmlEntity
Test if this MusicXML entity has the same content as another object.

Overrides:
equals in class MusicXmlEntity
Parameters:
other - The other object.
Returns:
True if both objects have the same content; false otherwise.