+ /**
+ * Readable representation, for debug only, not guaranteed not to change
+ * between versions
+ */
+ @Override
+ public String toString()
+ {
+ return String.format("%d %d %s %s", getBegin(), getEnd(), getType(),
+ getDescription());
+ }
+
+ /**
+ * Overridden to ensure that whenever two objects are equal, they have the
+ * same hashCode
+ */
+ @Override
+ public int hashCode()
+ {
+ String s = getType() + getDescription() + getFeatureGroup()
+ + getValue("ID") + getValue("Name") + getValue("Parent")
+ + getPhase();
+ 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.
+ */
+ @Override
+ public boolean isContactFeature()
+ {
+ return contactFeature;
+ }
+
+ /**
+ * Answers true if the sequence has zero start and end position
+ *
+ * @return
+ */
+ public boolean isNonPositional()
+ {
+ return begin == 0 && end == 0;
+ }