- /**\r
- * Consistency test for alignmentOrders\r
- * @param o\r
- * // TODO: Weak SequenceI equivalence - will throw Error at moment\r
- * @param identity - false - use weak equivalence (refers to same or different parts of same sequence)\r
- * @return true if o contains or is contained by this and the common SequenceI objects are ordered in the same way\r
- */\r
- public boolean isConsistent(AlignmentOrder o, boolean identity) {\r
- if (o!=this) {\r
- if (o==null)\r
- return false;\r
- if (Order!=null && o.Order!=null) {\r
- Vector c,s;\r
- if (o.Order.size()>Order.size()) {\r
- c = o.Order;\r
- s = Order;\r
- } else {\r
- c = Order;\r
- s = o.Order;\r
- }\r
- if (!identity) {\r
- throw new Error("Weak sequenceI equivalence not yet implemented.");\r
- } else {\r
- // test if c contains s and order in s is conserved in c\r
- int last=-1;\r
- for (int i=0,j=s.size(); i<j; i++) {\r
- int pos=c.indexOf(s.elementAt(i)); // JBPNote - optimize by incremental position search\r
- if (pos>last) {\r
- last=pos;\r
- } else\r
- return false;\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ * Consistency test for alignmentOrders\r
+ * @param o\r
+ * @return true if o contains or is contained by this and the common SequenceI objects are ordered in the same way\r
+ */\r
+ public boolean isConsistent(AlignmentOrder o)\r
+ {\r
+ return isConsistent(o, true);\r
+ }\r
+\r
+ /**\r
+ * Consistency test for alignmentOrders\r
+ * @param o\r
+ * // TODO: Weak SequenceI equivalence - will throw Error at moment\r
+ * @param identity - false - use weak equivalence (refers to same or different parts of same sequence)\r
+ * @return true if o contains or is contained by this and the common SequenceI objects are ordered in the same way\r
+ */\r
+ public boolean isConsistent(AlignmentOrder o, boolean identity)\r
+ {\r
+ if (o != this)\r
+ {\r
+ if (o == null)\r
+ {\r
+ return false;\r
+ }\r
+ if (Order != null && o.Order != null)\r
+ {\r
+ Vector c, s;\r
+ if (o.Order.size() > Order.size())\r
+ {\r
+ c = o.Order;\r
+ s = Order;\r
+ }\r
+ else\r
+ {\r
+ c = Order;\r
+ s = o.Order;\r
+ }\r
+ if (!identity)\r
+ {\r
+ throw new Error("Weak sequenceI equivalence not yet implemented.");\r
+ }\r
+ else\r
+ {\r
+ // test if c contains s and order in s is conserved in c\r
+ int last = -1;\r
+ for (int i = 0, j = s.size(); i < j; i++)\r
+ {\r
+ int pos = c.indexOf(s.elementAt(i)); // JBPNote - optimize by incremental position search\r
+ if (pos > last)\r
+ {\r
+ last = pos;\r
+ }\r
+ else\r
+ {\r
+ return false;\r