/*****************************************************************
 * Memorial University of Newfoundland<br>
 * 8893 Concurrent Programming<br>
 * Assignment 3, Question 1 - Chopstick class
 *
 * @author Dennis Peters
 * @version 2002.02.28
 ****************************************************************/
class Chopstick {
  boolean inUse;

  Chopstick()
  {
    inUse = false;
  }

  public void up()
  {
    if (inUse) {
      System.out.println("ERROR: chopstick already up.");
    }
    inUse = true;
  }

  public void down()
  {
    if (!inUse) {
      System.out.println("ERROR: chopstick already down.");
    }
    inUse = false;
  }
}

