JAL-4241 Add SequenceI.setSequence(char[]) method
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Thu, 14 Sep 2023 14:36:16 +0000 (16:36 +0200)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Thu, 14 Sep 2023 14:36:16 +0000 (16:36 +0200)
src/jalview/datamodel/Sequence.java
src/jalview/datamodel/SequenceI.java

index 4230366..89c55e6 100755 (executable)
@@ -594,6 +594,14 @@ public class Sequence extends ASequence implements SequenceI
     return this.sequence.length;
   }
 
+  @Override
+  public void setSequence(char[] seq)
+  {
+    this.sequence = Arrays.copyOf(seq, seq.length);
+    checkValidRange();
+    sequenceChanged();
+  }
+
   /**
    * DOCUMENT ME!
    * 
index 11aa4e6..82575ec 100755 (executable)
@@ -101,6 +101,14 @@ public interface SequenceI extends ASequenceI
   public int getLength();
 
   /**
+   * Replace the sequence with the given characters
+   * 
+   * @param sequence
+   *          new sequence characters
+   */
+  public void setSequence(char[] sequence);
+
+  /**
    * Replace the sequence with the given string
    * 
    * @param sequence