Fix ErrorRatePerCycle to overload equals and hashcode

-- Fixes failing integration tests
This commit is contained in:
Mark DePristo 2012-03-27 10:34:56 -04:00
parent c07a577ba3
commit 913c8b231f
1 changed files with 19 additions and 0 deletions

View File

@ -91,6 +91,25 @@ public class ErrorRatePerCycle extends LocusWalker<Integer, Integer> {
this.cycle = cycle;
}
// Must overload hashCode and equals to properly work with GATKReportColumn
@Override
public int hashCode() {
return readGroup.hashCode() + 33 * cycle;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final TableKey oKey = (TableKey) o;
if ( cycle != oKey.cycle ) return false;
if ( !readGroup.equals(oKey.readGroup) ) return false;
return true;
}
@Override
public int compareTo(final TableKey tableKey) {
final int scmp = readGroup.compareTo(tableKey.readGroup);