net.charlesames.music.musicxml
Class Sound

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

public class Sound
extends MusicXmlEntity

The Sound class implements the MusicXML <sound> element.

Author:
Charles Ames

Method Summary
 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 Sound fromXmlNode(org.w3c.dom.Element element, MusicXmlEntity container)
          Create a new Sound instance and fill it with loaded data.
 double getDynamics()
          Getter for the Dynamics property
static Sound getInstance(MusicXmlEntity container)
          Create a new Sound instance.
 int getTempo()
          Getter for the Tempo property
 boolean hasContent()
          Test if this Sound instance has content.
 void putXmlData(org.w3c.dom.Element element)
           
 void setDynamics(double dynamics)
          Setter for the Dynamics property
 void setTempo(int tempo)
          Setter for the Tempo 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.MusicXmlEntity
getContainer, 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.

Specified by:
dispose in class Disposable

getInstance

public static Sound getInstance(MusicXmlEntity container)
Create a new Sound instance.

Parameters:
container - The MusicXmlEntity which will contain the new Sound instance.
Returns:
The newly created Sound instance.

getTempo

public int getTempo()
Getter for the Tempo property

Returns:
The current Tempo value.

setTempo

public void setTempo(int tempo)
Setter for the Tempo property

Parameters:
tempo - The intended Tempo value.

getDynamics

public double getDynamics()
Getter for the Dynamics property

Returns:
The current Dynamics value.

setDynamics

public void setDynamics(double dynamics)
Setter for the Dynamics property

Parameters:
dynamics - The intended Dynamics value.

hasContent

public boolean hasContent()
Test if this Sound instance has content.

Returns:
True if tempo or dynamics or both fall in meaningful ranges; false otherwise.

fromXmlNode

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

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

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.