Package trclib.archive
Class TrcSong.Section
java.lang.Object
trclib.archive.TrcSong.Section
- Enclosing class:
- TrcSong
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
This method returns the name of the section.This method returns the next note in the section.boolean
This method determines if there is a next note in the section.void
rewind()
This method rewinds the note pointer back to the beginning of the section.
-
Field Details
-
name
-
notes
-
noteIndex
private int noteIndex
-
-
Constructor Details
-
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
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
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.
-