musiccreator
Class TimeSignature

java.lang.Object
  extended by musiccreator.TimeSignature

public class TimeSignature
extends java.lang.Object

Implements the TimeSignature class, which describes the musical time- signature of a song. A TimeSignature object has a "top", or number of beats- per measure, and a "bottom", or type of beat.


Constructor Summary
TimeSignature()
          Creates a new instance of TimeSignature; defaults to 4/4.
TimeSignature(int t, int b)
          Constructor for time-signature
 
Method Summary
 int getBottom()
          Get the type of beat of a time-signature.
 java.lang.String getName()
          Get the time-signature in String format.
 int getTop()
          Get the beats-per-measure of a time-signature.
 void setBottom(int b)
          Set the type of beat of a time-signature.
 void setTop(int t)
          Set the beats-per-measure of a time-signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeSignature

public TimeSignature()
Creates a new instance of TimeSignature; defaults to 4/4.


TimeSignature

public TimeSignature(int t,
                     int b)
Constructor for time-signature

Parameters:
t - Number of beats per measure
b - Size of beat (4=quarter, 8=8th, etc.)
Method Detail

setTop

public final void setTop(int t)
Set the beats-per-measure of a time-signature.

Parameters:
t - Set number of beats-per-measure

setBottom

public final void setBottom(int b)
Set the type of beat of a time-signature.

Parameters:
b - Size of beat in a measure (2=half, 4=quarter, etc.)

getTop

public final int getTop()
Get the beats-per-measure of a time-signature.

Returns:
Number of beats per measure

getBottom

public final int getBottom()
Get the type of beat of a time-signature.

Returns:
Size of beat (2=half, 4=quarter, 8=8th, etc.)

getName

public final java.lang.String getName()
Get the time-signature in String format.

Returns:
getName of the time signature in musical terms (i.e., "4/4", "3/4")