package compbio.data.sequence; import java.util.Arrays; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import compbio.util.annotation.Immutable; @XmlAccessorType(XmlAccessType.FIELD) @Immutable public class Score { private Method method; private List scores; private Score() { // JaXB default constructor } public Score(Method method, List scores) { this.method = method; this.scores = scores; } public Method getMethod() { return method; } public List getScores() { return scores; } @Override public String toString() { return "Score [method=" + method + ", scores=" + scores + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((method == null) ? 0 : method.hashCode()); result = prime * result + ((scores == null) ? 0 : scores.hashCode()); return result; } /* * TODO test ! (non-Javadoc) * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Score other = (Score) obj; if (method != other.method) return false; if (scores == other.scores) { return true; } if (scores == null) { return false; } if (!Arrays.deepEquals(scores.toArray(), other.scores.toArray())) return false; return true; } }