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;
+ }
}
sf1.setStatus("new");
assertTrue(sf1.equals(sf2));
}
+
+ @Test(groups = { "Functional" })
+ public void testIsContactFeature()
+ {
+ SequenceFeature sf = new SequenceFeature("type", "desc", 22, 33, 12.5f,
+ "group");
+ assertFalse(sf.isContactFeature());
+ sf.setType("");
+ assertFalse(sf.isContactFeature());
+ sf.setType(null);
+ assertFalse(sf.isContactFeature());
+ sf.setType("Disulfide Bond");
+ assertTrue(sf.isContactFeature());
+ sf.setType("disulfide bond");
+ assertTrue(sf.isContactFeature());
+ sf.setType("Disulphide Bond");
+ assertTrue(sf.isContactFeature());
+ sf.setType("disulphide bond");
+ assertTrue(sf.isContactFeature());
+ }
}