jcaas.midi.staticStaff
Class Mary

java.lang.Object
  extended by jcaas.midi.staticStaff.Mary
All Implemented Interfaces:
Staff

public class Mary
extends java.lang.Object
implements Staff

A simple implementation of Mary Had a Little Lamb. Effectively, only the tempo is variable.

Version:
last updated: 4/17/05
Author:
Conrad Hutcheson

Constructor Summary
Mary()
          Constructor.
 
Method Summary
 StaffProperty getCurrentProperty(java.lang.String propertyName)
          Returns the current value for a given property in a Song.
 StaffProperty getDefaultProperty(java.lang.String propertyName)
          Returns the default value for a given property in a Song.
 NoteVector getNextNote()
          getNextNote returns the next note in the sqeuence of the Song.
 void reset()
          Resets all current values for Song properties to their default values and resets the note-position to the first note.
 void resetProperty(java.lang.String propertyName)
          Resets the current value for a given property in a Song to its default value.
 void setProperty(java.lang.String propertyName, StaffProperty p)
          Sets the current value for a given property in a Song.
 java.lang.String toString()
          Overwrites Object's toString method to return the Song's Title.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mary

public Mary()
Constructor. Initialize values.

Method Detail

getNextNote

public NoteVector getNextNote()
getNextNote returns the next note in the sqeuence of the Song. The behavior is such that when the end of the song is reached, the song will loop.

Specified by:
getNextNote in interface Staff
Returns:
the next Note to be played.

getDefaultProperty

public StaffProperty getDefaultProperty(java.lang.String propertyName)
Returns the default value for a given property in a Song. Valid properties are names of classes that extend StaffProperty.

Specified by:
getDefaultProperty in interface Staff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.
Returns:
the StaffProperty, which will be a class of type propertyName that is defualt for this song. null if this property is not implemented.

getCurrentProperty

public StaffProperty getCurrentProperty(java.lang.String propertyName)
Returns the current value for a given property in a Song. Valid properties are names of classes that extend StaffProperty.

Specified by:
getCurrentProperty in interface Staff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.
Returns:
the StaffProperty, which will be a class of type propertyName that is current for this song. null if this property is not implemented.

setProperty

public void setProperty(java.lang.String propertyName,
                        StaffProperty p)
Sets the current value for a given property in a Song. Valid properties are names of classes that extend StaffProperty.

Specified by:
setProperty in interface Staff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.
p - - the StaffProperty, which must be a class of type propertyName that is current for this song. null if this property is not implemented.

resetProperty

public void resetProperty(java.lang.String propertyName)
Resets the current value for a given property in a Song to its default value. Valid properties are names of classes that extend StaffProperty.

Specified by:
resetProperty in interface Staff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.

reset

public void reset()
Resets all current values for Song properties to their default values and resets the note-position to the first note. Valid properties are names of classes that extend StaffProperty.

Specified by:
reset in interface Staff

toString

public java.lang.String toString()
Overwrites Object's toString method to return the Song's Title.

Overrides:
toString in class java.lang.Object
Returns:
the String name of the Song.