git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into feature/JAL-3551Pymol
[jalview.git]
/
src
/
jalview
/
datamodel
/
features
/
FeatureStore.java
diff --git
a/src/jalview/datamodel/features/FeatureStore.java
b/src/jalview/datamodel/features/FeatureStore.java
index
54c0d59
..
7651016
100644
(file)
--- a/
src/jalview/datamodel/features/FeatureStore.java
+++ b/
src/jalview/datamodel/features/FeatureStore.java
@@
-20,8
+20,6
@@
*/
package jalview.datamodel.features;
*/
package jalview.datamodel.features;
-import jalview.datamodel.SequenceFeature;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@
-30,7
+28,9
@@
import java.util.Set;
import intervalstore.api.IntervalStoreI;
import intervalstore.impl.BinarySearcher;
import intervalstore.api.IntervalStoreI;
import intervalstore.impl.BinarySearcher;
+import intervalstore.impl.BinarySearcher.Compare;
import intervalstore.impl.IntervalStore;
import intervalstore.impl.IntervalStore;
+import jalview.datamodel.SequenceFeature;
/**
* A data store for a set of sequence features that supports efficient lookup of
/**
* A data store for a set of sequence features that supports efficient lookup of
@@
-277,7
+277,7
@@
public class FeatureStore
* binary search the sorted list to find the insertion point
*/
int insertPosition = BinarySearcher.findFirst(contactFeatureStarts,
* 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);
contactFeatureStarts.add(insertPosition, feature);
@@
-286,7
+286,7
@@
public class FeatureStore
* binary search the sorted list to find the insertion point
*/
insertPosition = BinarySearcher.findFirst(contactFeatureEnds,
* 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;
contactFeatureEnds.add(insertPosition, feature);
return true;
@@
-314,8
+314,8
@@
public class FeatureStore
*/
// int pos = binarySearch(features,
// SearchCriterion.byFeature(feature, RangeComparator.BY_START_POSITION));
*/
// 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)
{
int len = features.size();
while (pos < len)
{
@@
-396,7
+396,7
@@
public class FeatureStore
* whose end point is not before the target range
*/
int index = BinarySearcher.findFirst(contactFeatureEnds,
* 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())
{
while (index < contactFeatureEnds.size())
{
@@
-449,7
+449,7
@@
public class FeatureStore
List<SequenceFeature> result)
{
int index = BinarySearcher.findFirst(contactFeatureStarts,
List<SequenceFeature> result)
{
int index = BinarySearcher.findFirst(contactFeatureStarts,
- f -> f.getBegin() >= from);
+ true, Compare.GE, (int) from);
while (index < contactFeatureStarts.size())
{
while (index < contactFeatureStarts.size())
{