From: amwaterhouse Date: Thu, 10 Feb 2005 13:20:33 +0000 (+0000) Subject: isAligned method added X-Git-Tag: Release_2_0~682 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2a64503d035e47cf9a40e5de979fd22980e50106;p=jalview.git isAligned method added --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 0875450..62b9ea9 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -500,6 +500,17 @@ public class Alignment implements AlignmentI { return AAFrequency.calculate(sequences, 0, getWidth()); } + + public boolean isAligned() + { + int width = getWidth(); + for (int i = 0; i < sequences.size(); i++) + if (getSequenceAt(i).getLength() != width) + return false; + + return true; + + } } diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java index 80b22ae..182b687 100755 --- a/src/jalview/datamodel/AlignmentI.java +++ b/src/jalview/datamodel/AlignmentI.java @@ -11,6 +11,8 @@ public interface AlignmentI { public int getWidth() ; public int getMaxIdLength() ; + public boolean isAligned(); + public Vector getSequences(); public SequenceI getSequenceAt(int i);