From 1fea111206bcb8b84284805a3b6e233d5879084c Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 9 Mar 2005 18:35:46 +0000 Subject: [PATCH] allows deletion of chars --- src/jalview/datamodel/Sequence.java | 7 +++++++ src/jalview/datamodel/SequenceI.java | 1 + 2 files changed, 8 insertions(+) diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 691a1f1..99f2de2 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -201,6 +201,13 @@ public class Sequence implements SequenceI sequence = sbuffer.toString(); } + public void deleteChars(int i, int j) + { + StringBuffer sbuffer = new StringBuffer(sequence); + sbuffer.delete(i,j); + sequence = sbuffer.toString(); + } + public void insertCharAt(int i, char c) { insertCharAt(i,c,true); diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 75b17eb..a056a36 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -30,6 +30,7 @@ public interface SequenceI { public int findIndex(int pos); public int findPosition(int i); + public void deleteChars(int i, int j); public void deleteCharAt(int i); public void insertCharAt(int i, char c); public void insertCharAt(int i,char c,boolean chop); -- 1.7.10.2