From 61344a1cbd2261b717c0961ae249be500d203a19 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 11 May 2017 15:29:00 +0100 Subject: [PATCH] =?utf8?q?JAL-2507=20test=20if=20an=20annotation=20is=20=E2=80?= =?utf8?q?=98whitespace=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/datamodel/Annotation.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/jalview/datamodel/Annotation.java b/src/jalview/datamodel/Annotation.java index fc8688c..8de8eb2 100755 --- a/src/jalview/datamodel/Annotation.java +++ b/src/jalview/datamodel/Annotation.java @@ -198,4 +198,18 @@ public class Annotation } return sb.toString(); } + + /** + * @return true if annot is 'whitespace' annotation (zero score, whitespace or + * zero length display character, label, description + */ + public boolean isWhitespace() + { + return ((value == 0f) + && ((description == null) || (description.trim() + .length() == 0)) + && ((displayCharacter == null) || (displayCharacter + .trim().length() == 0)) + && (secondaryStructure == '\0' || (secondaryStructure == ' ')) && colour == null); + } } -- 1.7.10.2