public boolean equals(Object obj) {
    if (!(obj instanceof HSSFRow)) {
      return false;
    }
    HSSFRow loc = (HSSFRow) obj;

    if (this.getRowNum() == loc.getRowNum()) {
      return true;
    }
    return false;
  }
  public int compareTo(Object obj) {
    HSSFRow loc = (HSSFRow) obj;

    if (this.getRowNum() == loc.getRowNum()) {
      return 0;
    }
    if (this.getRowNum() < loc.getRowNum()) {
      return -1;
    }
    if (this.getRowNum() > loc.getRowNum()) {
      return 1;
    }
    return -1;
  }