public class ITSystem
{
  private int id;      // local inventory no.
  private int roomNo;  // location
  private int problems; // count of reported problems
  
  /**
   * A constructor for creating a new ITSystem.
   *
   * @param id  unique id of system
   * @param roomNo  location of system
   * @param problems number of reported problems for system
   */
  
  public ITSystem( int id, int roomNo, int problems )
  {
    this.id = id;
    this.roomNo = roomNo;
    this.problems = problems;
  }
  
  /**
   * Record problem
   *
   */
  
  public void recordProblem()
  {
    problems++;
  }
  
  public int getId()
  {
    return id;
  }
  
  public int getRoomNo()
  {
    return roomNo;
  }
  
  public int getProblemCount()
  {
    return problems;
  }
  public String toString(){
    return "ID: " + id + ", Room: " + roomNo + ",   " + problems;
  }
  public void changeRoomNo(int r){
    this.roomNo = r;
  }
  // ITSystems are identified by id, so two objects
  // with the same id are considered equal.
  // This code is based on Point's equal, pg. 577.
  public boolean equals(Object o) {
    if (o instanceof ITSystem) {
      ITSystem other = (ITSystem)o;
      return id == other.id;
    } else { // not an ITSystem object
      return false;
    }
  }
}

