simple.time
Class TimerFactory

java.lang.Object
  extended by simple.time.TimerFactory

public final class TimerFactory
extends java.lang.Object

Creates various timers.
Created: Nov 9, 2010

Author:
Kenneth Pierce

Nested Class Summary
static class TimerFactory.Algorithm
           
 
Constructor Summary
TimerFactory()
           
 
Method Summary
static java.lang.String getTime(long milli)
          Formats the time to H:m:s
static java.lang.String getTimeLong(long milli)
          Formats the time to "H hours, m minutes, s seconds"
static java.lang.String getTimeLongPrecise(long milli)
          Formats the time to "H hours, m minutes, s seconds, M milliseconds"
static java.lang.String getTimePrecise(long milli)
          Formats the time to H:m:s.M
static TimeRemainingEstimator getTRETimer(TimerFactory.Algorithm algorithm, int sampleSize)
          Gets a timer with the specified algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerFactory

public TimerFactory()
Method Detail

getTRETimer

public static TimeRemainingEstimator getTRETimer(TimerFactory.Algorithm algorithm,
                                                 int sampleSize)
Gets a timer with the specified algorithm. sampleSize does not apply to TOTALAVG.

Parameters:
algorithm -
sampleSize -
Returns:
A timer that uses the specified algorithm.

getTime

public static java.lang.String getTime(long milli)
Formats the time to H:m:s

Parameters:
milli -
Returns:
the formatted time

getTimeLong

public static java.lang.String getTimeLong(long milli)
Formats the time to "H hours, m minutes, s seconds"

Parameters:
milli -
Returns:
the formatted time

getTimePrecise

public static java.lang.String getTimePrecise(long milli)
Formats the time to H:m:s.M

Parameters:
milli -
Returns:
the formatted time

getTimeLongPrecise

public static java.lang.String getTimeLongPrecise(long milli)
Formats the time to "H hours, m minutes, s seconds, M milliseconds"

Parameters:
milli -
Returns:
the formatted time