net.charlesames.music.musicxml
Class MeasureInPart

java.lang.Object
  extended by net.charlesames.utility.common.Disposable
      extended by net.charlesames.music.musicxml.MusicXmlEntity
          extended by net.charlesames.music.musicxml.Measure
              extended by net.charlesames.music.musicxml.MeasureInPart

public class MeasureInPart
extends Measure

The MeasureInPart class implements the MusicXML <measure> element.

Author:
Charles Ames

Method Summary
 Clef createClef(int time, int number, Clef.ClefSign sign, int line, int octave)
          Insert a Clef instance at the indicated time 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 MeasureInPart fromXmlNode(org.w3c.dom.Element element, PartInScore container)
          Create a new MeasureInPart instance and fill it with loaded data.
 PartInScore getContainer()
          Get the parent object.
 Direction getDirection(int offset, int staff, int voice, Placement placement)
          Locate a Direction instance in the measure; if not found create.
 void putXmlData(org.w3c.dom.Element element)
           
 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.Measure
addEvent, advanceTime, createBarline, createKeySignature, createTimeSignature, divisionsFromRatio, getAttributes, getDivisions, getEvents, getImplicit, getMeasureDuration, getMeasurePrint, getNoteDuration, getNumber, getTime, getWidth, setDivisions, setImplicit, setMeasureDuration, setMeasurePrint, setNoteDuration, setNumber, setStaves, setTime, setWidth
 
Methods inherited from class net.charlesames.music.musicxml.MusicXmlEntity
makeDirty
 
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.

Overrides:
dispose in class Measure

getContainer

public PartInScore getContainer()
Description copied from class: MusicXmlEntity
Get the parent object.

Overrides:
getContainer in class MusicXmlEntity
Returns:
The parent object.

createClef

public Clef createClef(int time,
                       int number,
                       Clef.ClefSign sign,
                       int line,
                       int octave)
Insert a Clef instance at the indicated time with the indicated parameters.

Parameters:
time - Event time
number - Staff number
sign - C F G X
line - Position of sign on staff.
octave - Octave displacement.
Returns:
The newly created Clef instance.

fromXmlNode

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

Parameters:
element - The XML element that provides the MeasureInPart data
container - The MusicXmlEntity which will contain the new MeasureInPart instance.
Returns:
The newly created MeasureInPart 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.

putXmlData

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

getDirection

public Direction getDirection(int offset,
                              int staff,
                              int voice,
                              Placement placement)
Locate a Direction instance in the measure; if not found create.

Parameters:
offset -
staff -
voice -
placement -
Returns:
The Direction 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 Measure
Parameters:
other - The other object.
Returns:
True if both objects have the same content; false otherwise.