import jalview.datamodel.features.FeatureSources;
import jalview.util.StringUtils;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.Vector;
+import intervalstore.api.IntervalI;
+
/**
* A class that models a single contiguous feature on a sequence. If flag
* 'contactFeature' is true, the start and end positions are interpreted instead
private String source;
/**
+ * 1-based index into the featureList used by FeatureStoreJS
+ */
+ public int index1;
+
+ /**
+ * containment nesting link used by FeatureStoreJS to track starting points
+ */
+ public SequenceFeature containedBy;
+
+ /**
* Constructs a duplicate feature. Note: Uses makes a shallow copy of the
* otherDetails map, so the new and original SequenceFeature may reference the
* same objects in the map.
{
source = theSource;
}
+
+ @Override
+ public IntervalI getContainedBy()
+ {
+ return containedBy;
+ }
+
+ @Override
+ public void setContainedBy(IntervalI containedBy)
+ {
+ this.containedBy = (SequenceFeature) containedBy;
+
+ }
+
+}
+
+class SFSortByEnd implements Comparator<SequenceFeature>
+{
+ @Override
+ public int compare(SequenceFeature a, SequenceFeature b)
+ {
+ return a.getEnd() - b.getEnd();
+ }
+}
+
+class SFSortByBegin implements Comparator<SequenceFeature>
+{
+ @Override
+ public int compare(SequenceFeature a, SequenceFeature b)
+ {
+ return a.getBegin() - b.getBegin();
+ }
}