- int begin1 = range1.getBegin();
- int begin2 = range2.getBegin();
- int end1 = range1.getEnd();
- int end2 = range2.getEnd();
- if (begin1 == begin2 && end1 > end2)
- {
- return true;
- }
- if (begin1 < begin2 && end1 >= end2)
- {
- return true;
+ this(INTERVAL_STORE_DEFAULT);
+ }
+
+ /**
+ * constructor for testing only
+ */
+ public FeatureStore(int intervalStoreType)
+ {
+ features =
+ // Platform.isJS()
+ // ? new intervalstore.nonc.IntervalStore<>(true)
+ // : new intervalstore.impl.IntervalStore<>();
+ getIntervalStore(intervalStoreType);
+ positionalFeatureGroups = new HashSet<>();
+ nonPositionalFeatureGroups = new HashSet<>();
+ positionalMinScore = Float.NaN;
+ positionalMaxScore = Float.NaN;
+ nonPositionalMinScore = Float.NaN;
+ nonPositionalMaxScore = Float.NaN;
+
+ // we only construct nonPositionalFeatures, contactFeatures if we need to
+ }
+
+ private IntervalStoreI<SequenceFeature> getIntervalStore(int type)
+ {
+ switch (type != INTERVAL_STORE_DEFAULT ? type : //
+ Platform.isJS() //
+ ? intervalStoreJSOption
+ : intervalStoreJavaOption)
+ {
+ default:
+ case INTERVAL_STORE_NCLIST_OBJECT:
+ return new intervalstore.impl.IntervalStore<>();
+ case INTERVAL_STORE_NCARRAY:
+ return new intervalstore.nonc.IntervalStoreImpl();
+ case INTERVAL_STORE_LINKED_LIST:
+ return new intervalstore.nonc.IntervalStore0Impl();