Esempio n. 1
0
  /**
   * Two RecordId objects are considered equal if they represent the same tuple.
   *
   * @return True if this and o represent the same tuple
   */
  @Override
  public boolean equals(Object o) {
    // some code goes here
    if (o instanceof RecordId) {
      RecordId tmp = (RecordId) o;

      return pid.equals(tmp.getPageId()) && tmp.tupleno == tupleno;
    }
    return false;
    // throw new UnsupportedOperationException("implement this");
  }
Esempio n. 2
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (!(obj instanceof RecordId)) {
     return false;
   }
   RecordId other = (RecordId) obj;
   if (pid == null) {
     if (other.pid != null) {
       return false;
     }
   } else if (!pid.equals(other.pid)) {
     return false;
   }
   if (tupleno != other.tupleno) {
     return false;
   }
   return true;
 }