/**
 * CS1101 (AY2009/10 Semester 1)
 * Peg.java
 * This class defines the coloured Peg.
 * Do not modify this program.
 * @author: Aaron Tan
 */

class Peg {
  
   // Data member
   private char colour;

   // Constructors
   public Peg() {
      this('R');
   }

   public Peg(Peg p) {
      this(p.getColour());
   }

   public Peg(char c) {
      setColour(c);
   }
   
   // Changes the colour of the peg
   public void setColour (char c) {
       colour = c;
   }

   // Returns colour of the peg 
   public char getColour () {
       return colour;
   }

   // Returns string representation of a Peg object
   public String toString () {
       return "" + getColour(); 
   }

}

