/** each instance describes a chapter in a book */

public class Chapter {
    
    private String title; //title of book
    private int number; // chapter number
    private Chapter previous; // previous chapter
    public static int numberChaps= 0; // number of folder
                                // that have been created
    
    /** Constructor: an instance with title t, chap n, previous c */
    public Chapter(String t, int n, Chapter c) {
        title= t;   number= n;   previous= c;
        numberChaps=  numberChaps + 1;
        
    }
    
    /** = title of this chapter */
    public String getTitle() {
        return title;   
    }
    
    /** = number of this chapter */
    public int getNumber() {
        return number;   
    }
    
    /** = previous chapter (null if none) */
    public Chapter getPrevious() {
        return previous;   
    }
    
    /** Set the title of the chapter to t */
    public void setTitle(String t) {
        title= t;
    }
    
    /** = the smaller of the chapter numbers of c1 and c2
     *    if they are the same, return that chapter number.*/
    public static int smaller(Chapter c1, Chapter c2) {
        return Math.min(c1.getNumber(), c2.getNumber());
        
    }
    
    
    
}