X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FFormat.java;h=0f12eb833a6973565eae6804d73d3c9fcc9115d0;hb=76f9992a5fd8e818f8051130e25c6aefb4ef51ad;hp=ce7ab6df184a5984bd2262536dc43799e9bf4ce9;hpb=05951a61acec617599e9a92828b8a498fab6ae32;p=jalview.git diff --git a/src/jalview/util/Format.java b/src/jalview/util/Format.java index ce7ab6d..0f12eb8 100755 --- a/src/jalview/util/Format.java +++ b/src/jalview/util/Format.java @@ -29,10 +29,13 @@ package jalview.util; import java.util.Arrays; /** - * DOCUMENT ME! + * A utility class that provides a variety of formatting methods. * - * @author $author$ - * @version $Revision$ + * Principle method {@code format} formats the number following printf + * conventions. Main limitation: Can only handle one format parameter at a time + * Use multiple Format objects to format more than one number + * + * @author unknown */ public class Format { @@ -59,12 +62,59 @@ public class Format private final String formatString; /** - * Creates a new Format object. + * Creates a new Format object given a format descriptor, which follows printf + * conventions The string has a prefix, a format code and a suffix. The prefix + * and suffix become part of the formatted output. The format code directs the + * formatting of the (single) parameter to be formatted. The code has the + * following structure + * * * @param s - * DOCUMENT ME! + * the format descriptor */ - public Format(String s) + public Format(final String s) { formatString = s; width = 0; @@ -214,63 +264,11 @@ public class Format } /** - * Formats the number following printf conventions. Main limitation: Can only - * handle one format parameter at a time Use multiple Format objects to format - * more than one number - * - * @param s - * the format string following printf conventions The string has a - * prefix, a format code and a suffix. The prefix and suffix become - * part of the formatted output. The format code directs the - * formatting of the (single) parameter to be formatted. The code has - * the following structure - * - * @exception IllegalArgumentException - * if bad format + * Returns a 6 character string consisting of the hex values of the colour's + * rgb values (left padded with zeroes if necessary) * + * @param color + * @return */ public static String getHexString(java.awt.Color color) {