Class ScaleBranch

java.lang.Object
  extended by CollectableNode
      extended by SoundBranch
          extended by ScaleBranch

public class ScaleBranch
extends SoundBranch

Class that scales the children

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
ScaleBranch(double theFactor)
          Construct a branch with the passed factor
 
Method Summary
 Sound collect()
          Collect all the sound from the children, then collect from next.
 Sound collectAfter()
          Collect all the sound from the children, then collect from next.
 Sound collectSwap()
          Collect all the sound from next and then our children Scale the children But return the next BEFORE the children
 double getFactor()
          Method to get the scaling factor
 void setFactor(double theFactor)
          Method to set the scaling factor
 String toString()
          Method to return a string with information about this branch
 
Methods inherited from class SoundBranch
addChild, getFirstChild
 
Methods inherited from class CollectableNode
add, getNext, insertAfter, last, playFromMeOn, remove, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScaleBranch

public ScaleBranch(double theFactor)
Construct a branch with the passed factor

Parameters:
theFactor - the factor to use
Method Detail

getFactor

public double getFactor()
Method to get the scaling factor

Returns:
the scaling factor

setFactor

public void setFactor(double theFactor)
Method to set the scaling factor

Parameters:
theFactor - the new factor to use

toString

public String toString()
Method to return a string with information about this branch

Overrides:
toString in class SoundBranch
Returns:
the information string

collect

public Sound collect()
Collect all the sound from the children, then collect from next. Scale the getFirstChild()

Overrides:
collect in class SoundBranch
Returns:
the collected sound

collectAfter

public Sound collectAfter()
Collect all the sound from the children, then collect from next. Scale the next list, not the children

Overrides:
collectAfter in class SoundBranch
Returns:
the collected sound

collectSwap

public Sound collectSwap()
Collect all the sound from next and then our children Scale the children But return the next BEFORE the children

Overrides:
collectSwap in class SoundBranch
Returns:
the collected sound