org.kuali.maven.wagon
Class SimpleFormatter

java.lang.Object
  extended by org.kuali.maven.wagon.SimpleFormatter

public class SimpleFormatter
extends Object

Very simple formatter for formatting a few things - transfer rate, elapsed time, bytes

Since:
May 27, 2010 6:46:17 PM
Author:
Jeff Caddel

Field Summary
private static double FIFTEEN_MINUTES
           
private static double GB
           
private static double KB
           
private static double MB
           
private static double ONE_MINUTE
           
private static double ONE_SECOND
           
(package private)  NumberFormat rateFormatter
           
(package private)  NumberFormat sizeFormatter
           
(package private)  NumberFormat timeFormatter
           
 
Constructor Summary
SimpleFormatter()
           
 
Method Summary
 String getRate(long millis, long bytes)
          Given milliseconds and bytes return kilobytes per second
 String getSize(long bytes)
          Given bytes, return kilobytes if it is less than a megabyte, megabytes if it is less than a gigabyte, otherwise gigabytes
 String getTime(long millis)
          Given milliseconds, return seconds or minutes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KB

private static final double KB
See Also:
Constant Field Values

MB

private static final double MB
See Also:
Constant Field Values

GB

private static final double GB
See Also:
Constant Field Values

ONE_SECOND

private static final double ONE_SECOND
See Also:
Constant Field Values

ONE_MINUTE

private static final double ONE_MINUTE
See Also:
Constant Field Values

FIFTEEN_MINUTES

private static final double FIFTEEN_MINUTES
See Also:
Constant Field Values

sizeFormatter

NumberFormat sizeFormatter

timeFormatter

NumberFormat timeFormatter

rateFormatter

NumberFormat rateFormatter
Constructor Detail

SimpleFormatter

public SimpleFormatter()
Method Detail

getRate

public String getRate(long millis,
                      long bytes)
Given milliseconds and bytes return kilobytes per second


getTime

public String getTime(long millis)
Given milliseconds, return seconds or minutes


getSize

public String getSize(long bytes)
Given bytes, return kilobytes if it is less than a megabyte, megabytes if it is less than a gigabyte, otherwise gigabytes



Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.