*/
package jalview.datamodel.features;
-import jalview.datamodel.SequenceFeature;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import intervalstore.api.IntervalStoreI;
import intervalstore.impl.BinarySearcher;
+import intervalstore.impl.BinarySearcher.Compare;
import intervalstore.impl.IntervalStore;
+import jalview.datamodel.SequenceFeature;
/**
* A data store for a set of sequence features that supports efficient lookup of
* binary search the sorted list to find the insertion point
*/
int insertPosition = BinarySearcher.findFirst(contactFeatureStarts,
- f -> f.getBegin() >= feature.getBegin());
+ true, Compare.GE, feature.getBegin());
contactFeatureStarts.add(insertPosition, feature);
* binary search the sorted list to find the insertion point
*/
insertPosition = BinarySearcher.findFirst(contactFeatureEnds,
- f -> f.getEnd() >= feature.getEnd());
+ false, Compare.GE, feature.getEnd());
contactFeatureEnds.add(insertPosition, feature);
return true;
*/
// int pos = binarySearch(features,
// SearchCriterion.byFeature(feature, RangeComparator.BY_START_POSITION));
- int pos = BinarySearcher.findFirst(features,
- val -> val.getBegin() >= feature.getBegin());
+ int pos = BinarySearcher.findFirst(features, true, Compare.GE,
+ feature.getBegin());
int len = features.size();
while (pos < len)
{
* whose end point is not before the target range
*/
int index = BinarySearcher.findFirst(contactFeatureEnds,
- f -> f.getEnd() >= from);
+ false, Compare.GE, (int) from);
while (index < contactFeatureEnds.size())
{
List<SequenceFeature> result)
{
int index = BinarySearcher.findFirst(contactFeatureStarts,
- f -> f.getBegin() >= from);
+ true, Compare.GE, (int) from);
while (index < contactFeatureStarts.size())
{