- /**
- * Adds to the result list any contact features whose end (second contact
- * point), but not start (first contact point), lies in the query from-to
- * range
- *
- * @param from
- * @param to
- * @param result
- */
- protected void findContactEndFeatures(long from, long to,
- List<SequenceFeature> result)
- {
- /*
- * find the first contact feature (if any) that does not lie
- * entirely before the target range
- */
- int startPosition = binarySearch(contactFeatureEnds,
- SearchCriterion.byEnd(from));
- for (; startPosition < contactFeatureEnds.size(); startPosition++)
- {
- SequenceFeature sf = contactFeatureEnds.get(startPosition);
- if (!sf.isContactFeature())
- {
- System.err.println("Error! non-contact feature type "
- + sf.getType() + " in contact features list");
- continue;
- }
-
- int begin = sf.getBegin();
- if (begin >= from && begin <= to)
- {
- /*
- * this feature's first contact position lies in the search range
- * so we don't include it in results a second time
- */
- continue;
- }
-
- int end = sf.getEnd();
- if (end >= from && end <= to)
- {
- result.add(sf);
- }
- if (end > to)
- {
- break;
- }
- }
- }