X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceI.java;h=6e6d1aada4a1e4c5067ecda1dc3fd2e9d7444abd;hb=232f7d67b34c8e52c85d9fdf6d81392b889458c5;hp=ec76cb99abaf45a1264721752e550ffceba7f99f;hpb=4c6cd08af580ff73cfce39bec34ae4658a4b4b34;p=jalview.git diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index ec76cb9..6e6d1aa 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -22,6 +22,7 @@ package jalview.datamodel; import jalview.datamodel.features.SequenceFeaturesI; +import java.util.BitSet; import java.util.List; import java.util.Vector; @@ -118,9 +119,9 @@ public interface SequenceI extends ASequenceI public String getSequenceAsString(int start, int end); /** - * Get the sequence as a character array + * Answers a copy of the sequence as a character array * - * @return seqeunce and any gaps + * @return */ public char[] getSequence(); @@ -202,6 +203,16 @@ public interface SequenceI extends ASequenceI public int findPosition(int i); /** + * Returns the from-to sequence positions (start..) for the given column + * positions (1..), or null if no residues are included in the range + * + * @param fromColum + * @param toColumn + * @return + */ + public Range findPositions(int fromColum, int toColumn); + + /** * Returns an int array where indices correspond to each residue in the * sequence and the element value gives its position in the alignment * @@ -265,7 +276,7 @@ public interface SequenceI extends ASequenceI * Answers a list of all sequence features associated with this sequence. The * list may be held by the sequence's dataset sequence if that is defined. * - * @return hard reference to array + * @return */ public List getSequenceFeatures(); @@ -500,4 +511,27 @@ public interface SequenceI extends ASequenceI * @return */ List findFeatures(int fromCol, int toCol, String... types); + + /** + * Method to call to indicate that the sequence (characters or alignment/gaps) + * has been modified. Provided to allow any cursors on residue/column + * positions to be invalidated. + */ + void sequenceChanged(); + + /** + * + * @return BitSet corresponding to index [0,length) where Comparison.isGap() + * returns true. + */ + BitSet getInsertionsAsBits(); + + /** + * Replaces every occurrence of c1 in the sequence with c2 and returns the + * number of characters changed + * + * @param c1 + * @param c2 + */ + public int replace(char c1, char c2); }