net.charlesames.music.musicxml
Class Clef

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

public class Clef
extends MusicXmlEntity

The Clef class implements the MusicXML <clef> element.

Author:
Charles Ames

Nested Class Summary
static class Clef.ClefSign
          Allowed values for the Sign property.
 
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 Clef fromXmlNode(org.w3c.dom.Element element, MusicXmlEntity container)
          Create a new Clef instance and fill it with loaded data.
static Clef getInstance(MusicXmlEntity container)
          Create a new Clef instance.
 int getLine()
          Getter for the Line property.
 int getNumber()
          Getter for the Number property
 int getOctave()
          Getter for the Octave property.
 Clef.ClefSign getSign()
          Getter for the Sign property.
 void putXmlData(org.w3c.dom.Element element)
           
 void setLine(int line)
          Setter for the Line property.
 void setNumber(int number)
          Setter for the Number property.
 void setOctave(int octave)
          Setter for the Octave property.
 void setSign(Clef.ClefSign sign)
          Setter for the Sign 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 Clef getInstance(MusicXmlEntity container)
Create a new Clef instance.

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

getNumber

public int getNumber()
Getter for the Number property

Returns:
The current Number value.

setNumber

public void setNumber(int number)
Setter for the Number property.

Parameters:
number - The intended Number value.

getLine

public int getLine()
Getter for the Line property.

Returns:
The current Line value.

setLine

public void setLine(int line)
Setter for the Line property.

Parameters:
line - The intended Line value.

getOctave

public int getOctave()
Getter for the Octave property.

Returns:
The current Octave value.

setOctave

public void setOctave(int octave)
Setter for the Octave property.

Parameters:
octave - The intended Octave value.

getSign

public Clef.ClefSign getSign()
Getter for the Sign property.

Returns:
The current Sign value.

setSign

public void setSign(Clef.ClefSign sign)
Setter for the Sign property.

Parameters:
sign - The intended Sign value.

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)

fromXmlNode

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

Parameters:
element - The XML element that provides the Clef data
container - The MusicXmlEntity which will contain the new Clef instance.
Returns:
The newly created Clef 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 MusicXmlEntity
Parameters:
other - The other object.
Returns:
True if both objects have the same content; false otherwise.