}
/**
- * Returns a hashCode derived from the hashcodes of the mappings
+ * Returns a hashCode derived from the hashcodes of the mappings and fromSeq
*
* @see SequenceToSequenceMapping#hashCode()
*/
@Override
public int hashCode()
{
- return mapping.hashCode();
+ return (fromSeq == null ? 0 : fromSeq.hashCode() * 31)
+ + mapping.hashCode();
}
/**
{
return that.mapping == null;
}
- return this.mapping.equals(that.mapping);
+ // TODO: can simplify by asserting fromSeq is a dataset sequence
+ return (this.fromSeq == that.fromSeq || (this.fromSeq != null
+ && that.fromSeq != null
+ && this.fromSeq.getDatasetSequence() != null && this.fromSeq
+ .getDatasetSequence() == that.fromSeq
+ .getDatasetSequence())) && this.mapping.equals(that.mapping);
}
public SequenceI getFromSeq()