Class PipelinedUtils


  • public class PipelinedUtils
    extends Object
    • Constructor Detail

      • PipelinedUtils

        public PipelinedUtils()
    • Method Detail

      • formatAsPercentage

        public static String formatAsPercentage​(long numerator,
                                                long denominator)

        Format a percentage as a string with 2 decimal places. For instance: formatAsPercentage(52, 1000) returns "5.20".

      • toPercentage

        public static int toPercentage​(long numerator,
                                       long denominator)

        Convert to a percentage as an integer from 0 to 100, with -1 representing an undefined value.

      • formatAsTransferSpeedMBs

        public static String formatAsTransferSpeedMBs​(long numberOfBytes,
                                                      long timeMillis)
      • toPercentageAsInt

        public static int toPercentageAsInt​(long numerator,
                                            long denominator)