/**
 * The AVEquipment class represents a unit of 
 * audio-visual equipment such as a DVD player, 
 * a screen, a TV monitor, etc.
 */
public class AVEquipment {
  

  /** The total number of objects (instances) of this class. */
  private static int numUnits = 0; 

  /** The type of this equipment. */ 
  private String equipmentType;    

  /** The unique serial number of this object. */
  private int serialNumber;          
                                       
  /**
   * Default constructor which creates a piece of
   * AVEquipment assigning a new id number and no type.
   */
  public AVEquipment() {
    serialNumber= ++numUnits;
  }
  
  /**
   * Constructor which creates a piece of
   * AVEquipment with the String parameter as its type.
   */
  public AVEquipment(String type) {
    equipmentType= type;
    serialNumber= ++numUnits;
  }
  
  /**
   * Return the number of AVEquipment objects created.
   */
  public static int getTotalAVs() {
    return numUnits;
  }
  
  /**
   * Compares this AVEquipment to the given object; 
   * return true if they have the same equipment identification 
   * number, return false otherwise.
   */
  public boolean equals(AVEquipment other) {
    return (other != null) && (this.serialNumber == other.serialNumber);
  }
  /**
   * Return the serial number of this AVEquipment object.
   */
  public int getAVEquipmentID() {
    return serialNumber;
  }
  
  /**
   * Sets the type of equipment of this object to the 
   * given String parameter
   */
  public void setType(String type) {
    equipmentType= type;
  }
  
  /**
   * Return the equipment type of this object as a String 
   * value
   */
  public String getType() {
    return equipmentType;
  }
}
  


