Class TrcSong.Section

java.lang.Object
trclib.archive.TrcSong.Section
Enclosing class:
TrcSong

private static class TrcSong.Section extends Object
This class implements a notated section that contains a section name, an array of notes and keeps track of the next note of the section and provides a getNextNote() method to retrieve the next note to play.
  • Field Details

    • name

      private final String name
    • notes

      private final String[] notes
    • noteIndex

      private int noteIndex
  • Constructor Details

    • Section

      public Section(String name, String section)
      Constructor: Create an instance of the object.
      Parameters:
      name - specifies the name of the section.
      section - specifies the string that contains all the notated notes in the section.
  • Method Details

    • getName

      public String getName()
      This method returns the name of the section.
      Returns:
      section name.
    • hasNextNote

      public boolean hasNextNote()
      This method determines if there is a next note in the section.
      Returns:
      true if there is a next note, false otherwise.
    • getNextNote

      public String getNextNote()
      This method returns the next note in the section.
      Returns:
      next note to play or null if no more note.
    • rewind

      public void rewind()
      This method rewinds the note pointer back to the beginning of the section.