/** Each instance describes a chapter in a book 
 * */
public class Chapter {
    private String title; // The title of the chapter
    private int number; // The number of chapter
    private Chapter previous; // previous chapter (null if none)
    
    /** Constructor: an instance with title t, chapter
     *             number n, previous chapter c */
    public Chapter(String t, int n, Chapter c) {
        title= t;
        number= n;
        previous= c;
    }
    
    // Getter functions
    /** = title of this chapter */
    public String getTitle() {
        return title;
    }
    
    /** = number of this chapter */
    public int getNumber() {
        return number;
    }
    
    /** = (name of) the previous chapter (null if none) */
    public Chapter getPrevious() {
        return previous;
    }
    
    
    
    // Setter procedures
    /** Set the title to t */
    public void setTitle(String t) {
        title= t;
    }
    
    /** Set the chapter number to i */
    public void setNumber(int i) {
        number= i;
    }
    
    /** Set the previous chapter to c */
    public void setPrevious(Chapter c) {
        previous= c;
    }
   
}