JAL-3383 JAL-3253-applet additional efficiencies; FeatureStore
alternative to IntervalStore
- implemented for JavaScript only (see SequenceFeatures):
boolean useIntervalStore = /**
* @j2sNative false &&
*/
true;
but can be tested in Java and JavaScript by changing either of those to
true/false.
- only requires storage for one sorted array in FeatureSorter:
private SequenceFeature[] orderedFeatureStarts;
and one additional linked-list field pointer in SequenceFeature:
SequenceFeature containedBy
- when running, the position is looked up in the begin-sorted feature
array, and then the containedBy links are simply traversed using:
SequenceFeature sf = findClosestFeature(orderedFeatureStarts, pos);
while (sf != null) {
if (sf.end >= pos)
{
result.add(sf);
}
sf = sf.containedBy;
}
- my preliminary timing tests suggest this is 2x faster than
IntervalStore in JavaScript.