Module hw06

Class Tuplet

All Implemented Interfaces:
INote, IPhrase

public class Tuplet extends NoteCollection
Class that represents a tuplet, a series of notes played in a fraction of their normal total time. The exact fraction depends on the meter and the number of notes in the tuplet. A triplet is a specific type of tuplet.
Author:
swong ---------------------------------------------- A arbitrary set of notes played in sequence in a special manner.
  • Field Details

  • Constructor Details

    • Tuplet

      public Tuplet(Note... notes)
      Constructor for a tuplet
      Parameters:
      notes - vararg list of notes that form the tuplet, in order of play.
  • Method Details

    • execute

      public Object execute(IPhraseVisitor algo, Object... params)
      Calls the Tuplet.ID case of the visitor.
      Parameters:
      algo - the visitor being used
      params - vararg list of parameters for the visitor
      Returns:
      the result of the Tuplet case of the visitor.
    • toString

      public String toString()
      String representation of the tuplet:
      Overrides:
      toString in class Object
      Returns:
      "Tuplet(n1, n2, n3, etc)"