*/
private Map<String, FeatureStoreI> featureStore;
- private static boolean useIntervalStore = !Platform.isJS();
+ /**
+ * original NCList-based IntervalStore
+ */
+ private final static int INTERVAL_STORE_NCLIST = 0;
+
+ /**
+ * linked-list deferred-sort IntervalStore - experimental only; unused
+ */
+ private final static int INTERVAL_STORE_LINKED_LIST_NO_PRESORT = 1;
+
+ /**
+ * linked-list IntervalStore option for JavaScript
+ */
+ private final static int INTERVAL_STORE_LINKED_LIST = -1;
+
+ /**
+ * mode for Java or JavaScript; can be set differently for testing, but
+ * default is LINKED_LIST for JalviewJS and NCLIST for Java
+ */
+ private final int INTERVAL_STORE_MODE = (
+ // true || //
+ Platform.isJS() ? //
+ INTERVAL_STORE_LINKED_LIST //
+ : INTERVAL_STORE_NCLIST//
+ );
/**
* Constructor
private FeatureStoreI newFeatureStore()
{
- // TODO Auto-generated method stub
- return (useIntervalStore ? new FeatureStoreImpl() : new FeatureStoreJS());
+ switch (INTERVAL_STORE_MODE)
+ {
+ default:
+ case INTERVAL_STORE_NCLIST:
+ return new FeatureStoreImpl(true);
+ case INTERVAL_STORE_LINKED_LIST_NO_PRESORT:
+ return new FeatureStoreImpl(false);
+ case INTERVAL_STORE_LINKED_LIST:
+ return new FeatureStoreJS();
+ }
}
/**
List<SequenceFeature> result = new ArrayList<>();
for (FeatureStoreI featureSet : varargToTypes(type))
{
-// System.err.println("SF findFeature " + System.currentTimeMillis()
-// + " " + from + " " + to + " "
-// + featureSet.getPositionalFeatures().get(0).type);
-//
+ // System.err.println("SF findFeature " + System.currentTimeMillis()
+ // + " " + from + " " + to + " "
+ // + featureSet.getPositionalFeatures().get(0).type);
+ //
result.addAll(featureSet.findOverlappingFeatures(from, to, null));
}
return result;
return new ArrayList<>();
}
- return getAllFeatures(featureTypes.toArray(new String[featureTypes
- .size()]));
+ return getAllFeatures(
+ featureTypes.toArray(new String[featureTypes.size()]));
}
/**
return featureStore.values();
}
-
List<FeatureStoreI> types = new ArrayList<>();
List<String> args = Arrays.asList(type);
for (Entry<String, FeatureStoreI> featureType : featureStore.entrySet())
for (Entry<String, FeatureStoreI> featureType : featureStore.entrySet())
{
- Set<String> featureGroups = featureType.getValue().getFeatureGroups(
- positionalFeatures);
+ Set<String> featureGroups = featureType.getValue()
+ .getFeatureGroups(positionalFeatures);
for (String group : groups)
{
if (featureGroups.contains(group))
@Override
public float getMinimumScore(String type, boolean positional)
{
- return featureStore.containsKey(type) ? featureStore.get(type)
- .getMinimumScore(positional) : Float.NaN;
+ return featureStore.containsKey(type)
+ ? featureStore.get(type).getMinimumScore(positional)
+ : Float.NaN;
}
/**
@Override
public float getMaximumScore(String type, boolean positional)
{
- return featureStore.containsKey(type) ? featureStore.get(type)
- .getMaximumScore(positional) : Float.NaN;
+ return featureStore.containsKey(type)
+ ? featureStore.get(type).getMaximumScore(positional)
+ : Float.NaN;
}
/**
// Platform: timer mark 52.355 0.185 overviewrender 16000 pixels row:14
// Platform: timer mark 53.829 0.186 overviewrender 16000 pixels row:14
-
-
/**
* @author Bob Hanson 2019.08.01
*/