/** * You should implement the hashCode() so that two equal RecordId instances (with respect to * equals()) have the same hashCode(). * * @return An int that is the same for equal RecordId objects. */ @Override public int hashCode() { // some code goes here return Integer.parseInt(pid.hashCode() + Integer.toString(tupleno)); // throw new UnsupportedOperationException("implement this"); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((pid == null) ? 0 : pid.hashCode()); result = prime * result + tupleno; return result; }