/** An instance keeps information about a chapter of a book */
public class Chapter {
    
    private String title; // Title of the chapter
    private int number;   // Chapter number
    private Chapter previous; // the previous chapter
                             // (null if none or unknown)
    
    /* The purpose of a constructor (new kind of method) is to
       initialize some or all of the fields of a newly
       created object */
    
    /** Constructor: an instance with title t, chapter number
        n, and previous chapter c */
    public Chapter(String t, int n, Chapter c) {
        title= t;
        number= n;
        previous= c;
    }
    
   /** Set the title of this chapter to t */
    public void setTitle(String t) {
        title= t;
    }
   
   /** Set the  chapter number to n */
    public void setNumber(int n) {
        number= n;
    }
    
      /** Set the previous chapter to c */
    public void setPrevious(Chapter c) {
        previous= c;
    }

   
    // getters functions --"get" some value from the folder
    
    /** = the title of this chapter */
    public String getTitle() {
        return title;
    }
    
    /** = the chapter number */
    public int getNumber() {
        return number;
    }
    
    /** = the previous chapter (null if none) */
    public Chapter getPrevious() {
        return previous;
    }
  
    
    
}