Class SongElement

java.lang.Object
  extended by SongElement

public class SongElement
extends Object

Class that holds an element in a song

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
SongElement()
          Constructor that takes no arguments.
 
Method Summary
 double getEndTime()
          Method to get the end time for this element.
 SongElement getNext()
          Method to get the next element in the song
 void setNext(SongElement nextOne)
          Method to set the next element in the song
 void setPhrase(jm.music.data.Phrase myPhrase, double startTime, int instrument)
          This method takes a phrase and makes it the one for this element at the desired start time with the given instrument
 void showFromMeOn()
          Method to show the song from this element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SongElement

public SongElement()
Constructor that takes no arguments. The next part is empty, and ours is a blank new part

Method Detail

setPhrase

public void setPhrase(jm.music.data.Phrase myPhrase,
                      double startTime,
                      int instrument)
This method takes a phrase and makes it the one for this element at the desired start time with the given instrument

Parameters:
myPhrase - the phrase to use
startTime - the time to start this phrase
instrument - the instrument to use to play this

setNext

public void setNext(SongElement nextOne)
Method to set the next element in the song

Parameters:
nextOne - the element that should be next

getNext

public SongElement getNext()
Method to get the next element in the song

Returns:
the next element or null if none

getEndTime

public double getEndTime()
Method to get the end time for this element.

Returns:
the time this element ends

showFromMeOn

public void showFromMeOn()
Method to show the song from this element