Down here is a SoloNode.java code that I am working on. I dont know how to do the last 2 methods, they are:

public Phrase collect()

public String toString()


Java Code:
import jm.music.data.*;
import jm.JMC;
import jm.util.*;
import jm.music.tools.*;

public class SoloNode {
  
/////////Fields///////////  
  private SoloNode next;
  private Note myNote;
  
//////Constructurs/////
  public SoloNode(){
    this.next = null;
    this.myNote = new Note();
  }
  public SoloNode(Note myNote) {
    this.myNote = new Note();
  }
    
 /////Methods////////
  
  public void setNode(Note myNote) {
    this.myNote = myNote;
  }
  public void setNext(SoloNode next) {
    this.next = next;
  }
  public Note getNote() {
    return this.myNote;
  }
  
  public SoloNode getNext() {
    return this.next;
  }
 
  
}
The above program should work by typing the following in the Interaction Pane.
SoloNode node1 = new SoloNode(new Note(C4,QN));
SoloNode node2 = new SoloNode(new Note(D4,QN));
SoloNode node3 = new SoloNode(new Note(E4,QN));
node1.setNext(node2);
node2.setNext(node3);
View.notate(node1.collect());



Following is the code from the book, that I am using as a reference.
Java Code:
import jm.music.data.*;
import jm.JMC;
import jm.util.*;
import jm.music.tools.*;

public class SongNode {
  
/////////Fields///////////  
  private SongNode next;
  private Phrase myPhrase;
  
//////Constructurs/////
  public SongNode(){
    this.next = null;
    this.myPhrase = new Phrase();
  }
    
 /////Methods////////
  
  public void setPhrase(Phrase thisPhrase) {
    this.myPhrase = thisPhrase;
  }
  public void setNext(SongNode nextOne) {
    this.next = nextOne;
  }
  
  public SongNode getNext() {
    return this.next;
  }
  
  private Phrase getPhrase() {
    return this.myPhrase;
  }
  
  private Note[] getNotes() {
    return this.myPhrase.getNoteArray();
  }
  
  public void showFromMeOn(int instrument) {
    Score myScore = new Score("My Song");
    myScore.setTimeSignature(3,4);
    myScore.setTempo(120.0);
    
    Part myPart = new Part(instrument);
    Phrase collector = new Phrase();
    
    SongNode current = this;
    while (current != null) {
      collector.addNoteList(current.getNotes());
      
      current = current.getNext();
    }
    
    myPart.addPhrase(collector);
    myScore.addPart(myPart);
    
    View.notate(myScore);
  }
}