net.charlesames.music.musicxml
Class ScorePartwise

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

public class ScorePartwise
extends MusicXmlScore

The ScorePartwise, implements the MusicXML <score-partwise> element.

Author:
Charles Ames

Method Summary
 org.w3c.dom.DocumentType createDocumentType()
          Create an XML DocumentType.
 PartInScore createPart(ScorePart scorePart)
          Create a new PartInScore instance corresponding to the specified PartInScore instance.
 PartGroup createPartGroup(int number, StartStop type, java.lang.String name, GroupSymbol symbol)
          Create a new <@link PartGroup> instance with the indicated parameters.
 ScorePart createScorePart(java.lang.String id, java.lang.String name)
          Create a new <@link ScorePart> instance with the indicated parameters.
 void dispose()
          Release resources engaged by this object, thus rendering it amenable to garbage collection.
 boolean equals(MusicXmlEntity other)
          Test if this MusicXML entity has the same content as another object.
static ScorePartwise fromXmlNode(org.w3c.dom.Element element)
          Create a new ScorePartwise instance and fill it with loaded data.
 Identification getIdentification()
          Getter for the Identification property.
static ScorePartwise getInstance()
          Create a new ScorePartwise instance.
 java.lang.String getMovementTitle()
          Getter for the MovementTitle property.
 PartInScore getPart(ScorePart scorePart)
          Get the PartInScore instance corresponding to the specified ScorePart instance.
 java.util.List<MusicXmlEntity> getPartEntities()
          Get all ScorePart and PartGroup members.
 java.util.SortedMap<java.lang.String,PartInScore> getParts()
          Get all PartInScore members.
 ScorePart getScorePart(java.lang.String id)
          Get the ScorePart instance with the specified id.
 StaffLayout getStaffLayout()
          Getter for the StaffLayout property.
 SystemLayout getSystemLayout()
          Getter for the SystemLayout property.
 void putXmlData(org.w3c.dom.Element element)
           
 void setIdentification(Identification identification)
          Setter for the Identification property
 void setMovementTitle(java.lang.String movementTitle)
          Setter for the MovementTitle property
 void setPageLayout(PageLayout pageLayout)
          Setter for the PageLayout property
 void setStaffLayout(StaffLayout staffLayout)
          Setter for the StaffLayout property
 void setSystemLayout(SystemLayout systemLayout)
          Setter for the SystemLayout property
 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.MusicXmlScore
addCredit, getCredits, getVersion, isDirty, load, makeDirty, save
 
Methods inherited from class net.charlesames.music.musicxml.MusicXmlEntity
getContainer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

dispose

public void dispose()
Description copied from class: Disposable
Release resources engaged by this object, thus rendering it amenable to garbage collection.

Specified by:
dispose in class Disposable

getInstance

public static ScorePartwise getInstance()
Create a new ScorePartwise instance.

Returns:
The newly created ScorePartwise instance.

getMovementTitle

public java.lang.String getMovementTitle()
Getter for the MovementTitle property.

Returns:
The current MovementTitle value.

setMovementTitle

public void setMovementTitle(java.lang.String movementTitle)
Setter for the MovementTitle property

Parameters:
movementTitle - The intended MovementTitle value.

getIdentification

public Identification getIdentification()
Getter for the Identification property.

Returns:
The current Identification value.

setIdentification

public void setIdentification(Identification identification)
Setter for the Identification property

Parameters:
identification - The intended Identification value.

getSystemLayout

public SystemLayout getSystemLayout()
Getter for the SystemLayout property.

Returns:
The current SystemLayout value.

setSystemLayout

public void setSystemLayout(SystemLayout systemLayout)
Setter for the SystemLayout property

Parameters:
systemLayout - The intended SystemLayout value.

getStaffLayout

public StaffLayout getStaffLayout()
Getter for the StaffLayout property.

Returns:
The current StaffLayout value.

setPageLayout

public void setPageLayout(PageLayout pageLayout)
Setter for the PageLayout property

Parameters:
pageLayout - The intended PageLayout value.

setStaffLayout

public void setStaffLayout(StaffLayout staffLayout)
Setter for the StaffLayout property

Parameters:
staffLayout - The intended StaffLayout value.

getPartEntities

public java.util.List<MusicXmlEntity> getPartEntities()
Get all ScorePart and PartGroup members.

Returns:
A collection of ScorePart and PartGroup instances, indexed by id.

getScorePart

public ScorePart getScorePart(java.lang.String id)
Get the ScorePart instance with the specified id.

Parameters:
id - The specified id.
Returns:
The ScorePart instance with the specified id.

createScorePart

public ScorePart createScorePart(java.lang.String id,
                                 java.lang.String name)
Create a new <@link ScorePart> instance with the indicated parameters.

Parameters:
id - The score part identifier.
name - The score part name.
Returns:
The new <@link ScorePart> instance with the indicated parameters.
Throws:
java.lang.IllegalArgumentException - when the id is already used.

createPartGroup

public PartGroup createPartGroup(int number,
                                 StartStop type,
                                 java.lang.String name,
                                 GroupSymbol symbol)
Create a new <@link PartGroup> instance with the indicated parameters.

Parameters:
number - The part-group id.
type - The part-group type.
name - The part-group name.
symbol - The part-group display type
Returns:
The new <@link PartGroup> instance with the indicated parameters.

getParts

public java.util.SortedMap<java.lang.String,PartInScore> getParts()
Get all PartInScore members.

Returns:
A collection of PartInScore instances, indexed by ScorePart id.

getPart

public PartInScore getPart(ScorePart scorePart)
Get the PartInScore instance corresponding to the specified ScorePart instance.

Parameters:
scorePart - The specified ScorePart instance.
Returns:
The PartInScore instance corresponding to the specified ScorePart instance.
Throws:
java.lang.IllegalArgumentException - when no corresponding PartInScore instance is found.

createPart

public PartInScore createPart(ScorePart scorePart)
Create a new PartInScore instance corresponding to the specified PartInScore instance.

Parameters:
scorePart - The specified PartInScore instance.
Returns:
The new PartInScore instance corresponding to the specified PartInScore instance.
Throws:
java.lang.IllegalArgumentException - when a corresponding PartInScore already exists.

createDocumentType

public org.w3c.dom.DocumentType createDocumentType()
Description copied from class: MusicXmlScore
Create an XML DocumentType.

Specified by:
createDocumentType in class MusicXmlScore
Returns:
An XML DocumentType

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.

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

putXmlData

public void putXmlData(org.w3c.dom.Element element)
Overrides:
putXmlData in class MusicXmlScore

fromXmlNode

public static ScorePartwise fromXmlNode(org.w3c.dom.Element element)
Create a new ScorePartwise instance and fill it with loaded data.

Parameters:
element - The XML element that provides the ScorePartwise data
Returns:
The newly created ScorePartwise instance.

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 MusicXmlScore
Parameters:
other - The other object.
Returns:
True if both objects have the same content; false otherwise.