JAL-3397 impl.IntervalStore and nonc.IntervalStore unified api
[jalview.git] / src / jalview / datamodel / Sequence.java
index 6b52480..47a7ead 100755 (executable)
@@ -118,6 +118,11 @@ public class Sequence extends ASequence implements SequenceI
    */
   private int changeCount;
 
+  /*
+   * cached rgb colours for each position of the aligned sequence (column)
+   */
+  private int[] argb;
+
   /**
    * Creates a new Sequence object.
    * 
@@ -1612,7 +1617,7 @@ public class Sequence extends ASequence implements SequenceI
       _isNa = Comparison.isNucleotide(this);
     }
     return !_isNa;
-  };
+  }
 
   /*
    * (non-Javadoc)
@@ -1967,15 +1972,6 @@ public class Sequence extends ASequence implements SequenceI
 
     List<SequenceFeature> result = getFeatures().findFeatures(startPos,
             endPos, types);
-    if (datasetSequence != null)
-    {
-      result = datasetSequence.getFeatures().findFeatures(startPos, endPos,
-              types);
-    }
-    else
-    {
-      result = sequenceFeatureStore.findFeatures(startPos, endPos, types);
-    }
 
     /*
      * if end column is gapped, endPos may be to the right, 
@@ -2129,8 +2125,6 @@ public class Sequence extends ASequence implements SequenceI
     return 0;
   }
 
-  private int[] argb;
-
   @Override
   public int getColor(int i)
   {
@@ -2152,4 +2146,25 @@ public class Sequence extends ASequence implements SequenceI
   {
     argb = null;
   }
+
+  /**
+   * Answers a (possibly empty) list of features of the specified type that
+   * overlap the specified column position. If parameter {@code result} is not
+   * null, features are appended to it and the (possibly extended) list is
+   * returned.
+   */
+  @Override
+  public List<SequenceFeature> findFeatures(int column, String type,
+          List<SequenceFeature> result)
+  {
+    return getFeatures().findFeatures(findPosition(column - 1), type,
+            result);
+  }
+
+  @Override
+  public boolean hasFeatures(String type)
+  {
+    return getFeatures().hasFeatures(type);
+  }
+
 }