/*
 * University of Utah
 * 2005 High School Programming Contest
 * Record Matching
 *
 * Filename: Record.java
 * 
 * Description: Implements an object for storing individual records.
 *
 * Modification History:
 * 2/21/2005 - Initial Release
 */


public class Record {

  // Constructor
  public Record(String uid, String fName, String lName, String address,
                String zip, String phone, String email) {
    this.uid = uid;
    this.fName = fName;
    this.lName = lName;
    this.address = address;
    this.zip = zip;
    this.phone = phone;
    this.email = email; 
  }
  
  // Returns the unique identifier for this record.
  public String getUID() {
    return uid;
  }
  
  // A simple comparison function. Returns true if all the fields match
  // when they are lowercased. Returns false otherwise.
  //
  // Parameters:
  // r - Record to compare against.
  public boolean lowerCaseEquals(Record r) {
    return (fName.toLowerCase().equals(r.fName.toLowerCase()) &&
            lName.toLowerCase().equals(r.lName.toLowerCase()) &&
            address.toLowerCase().equals(r.address.toLowerCase()) &&
            zip.toLowerCase().equals(r.zip.toLowerCase()) &&
            phone.toLowerCase().equals(r.phone.toLowerCase()) &&
            email.toLowerCase().equals(r.email.toLowerCase()));
  }

  private String uid;       // Unique Identifier
  private String fName;     // First Name
  private String lName;     // Last Name
  private String address;   // Street Address
  private String zip;       // Zip Code
  private String phone;     // Phone Number
  private String email;     // Email Address
}

