From 2a64503d035e47cf9a40e5de979fd22980e50106 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 10 Feb 2005 13:20:33 +0000 Subject: [PATCH] isAligned method added --- src/jalview/datamodel/Alignment.java | 11 +++++++++++ src/jalview/datamodel/AlignmentI.java | 2 ++ 2 files changed, 13 insertions(+) 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); -- 1.7.10.2