}
SequenceFeature sf = (SequenceFeature) o;
- if (begin != sf.begin || end != sf.end || score != sf.score)
+ boolean sameScore = Float.isNaN(score) ? Float.isNaN(sf.score)
+ : score == sf.score;
+ if (begin != sf.begin || end != sf.end || !sameScore)
{
return false;
}
return s.hashCode() + getBegin() + getEnd() + (int) getScore()
+ getStrand();
}
+
+ /**
+ * Answers true if the feature's start/end values represent two related
+ * positions, rather than ends of a range. Such features may be visualised or
+ * reported differently to features on a range.
+ */
+ public boolean isContactFeature()
+ {
+ // TODO abstract one day to a FeatureType class
+ if ("disulfide bond".equalsIgnoreCase(type)
+ || "disulphide bond".equalsIgnoreCase(type))
+ {
+ return true;
+ }
+ return false;
+ }
}