From: Jim Procter Date: Thu, 11 May 2017 14:29:00 +0000 (+0100) Subject: JAL-2507 test if an annotation is ‘whitespace’ X-Git-Tag: Release_2_10_2~3^2~88^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=61344a1cbd2261b717c0961ae249be500d203a19;p=jalview.git JAL-2507 test if an annotation is ‘whitespace’ --- 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); + } }