X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fio%2FSequenceAnnotationReport.java;h=9d7fcfc82d399c5a2d07e06e9067432c808846c3;hp=4933cd6ca9295d404b37cb83ed1e0976b85ac719;hb=2b21aa74fdc06b43a1c6d80653e7bd51574b78bf;hpb=d281dbb95856e0796188c810b819519878235e36 diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index 4933cd6..9d7fcfc 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -20,6 +20,12 @@ */ package jalview.io; +import java.util.Collection; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + import jalview.api.FeatureColourI; import jalview.datamodel.DBRefEntry; import jalview.datamodel.DBRefSource; @@ -32,13 +38,6 @@ import jalview.util.StringUtils; import jalview.util.UrlLink; import jalview.viewmodel.seqfeatures.FeatureRendererModel; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - /** * generate HTML reports for a sequence * @@ -299,17 +298,26 @@ public class SequenceAnnotationReport appendFeature(sb, rpos, fr, feature, mf, 0); } + /** + * Appends {@code sb} to {@code sb0}, and returns false, unless + * {@code maxlength} is not zero and appending would make the total length + * greater than {@code maxlength}, in which case the text is not appended, and + * the method returns true. + * + * @param sb0 + * @param sb + * @param maxlength + * @return + */ private static boolean appendTextMaxLengthReached(StringBuilder sb0, StringBuilder sb, int maxlength) { - boolean ret = false; if (maxlength == 0 || sb0.length() + sb.length() < maxlength) { sb0.append(sb); return false; - } else { - return true; } + return true; } /**