Package org.terrier.utility
Class TerrierTimer
- java.lang.Object
- 
- java.lang.Thread
- 
- org.terrier.utility.TerrierTimer
 
 
- 
- All Implemented Interfaces:
- java.lang.Runnable
 
 public class TerrierTimer extends java.lang.ThreadThis class implements a timer.
- 
- 
Field SummaryFields Modifier and Type Field Description protected doubledoneNumber of items in task completedprotected shortlastPercentagethe last percentage that was output.protected java.lang.Stringmessagethe message that should be output with the progressprotected longstartingTimeThe starting system time in millisecond.protected doubletotalThe total number of items to process in a task.
 - 
Constructor SummaryConstructors Constructor Description TerrierTimer()TerrierTimer(java.lang.String message, double total)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringelapsed()Get a string summarising the processing/remaining time in minutes and seconds.voidfinished()shortgetPercentage()java.lang.StringgetRemainingTime()voidincrement()voidincrement(double dIncrememt)static java.lang.StringlongToText(long timems)voidrun()voidsetDone(double done)- 
Methods inherited from class java.lang.ThreadactiveCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
 
- 
 
- 
- 
- 
Field Detail- 
startingTimeprotected final long startingTime The starting system time in millisecond.
 - 
totalprotected final double total The total number of items to process in a task.
 - 
doneprotected volatile double done Number of items in task completed
 - 
lastPercentageprotected short lastPercentage the last percentage that was output. Set to a negative value, so that a value is always determined
 - 
messageprotected final java.lang.String message the message that should be output with the progress
 
- 
 - 
Method Detail- 
setDonepublic void setDone(double done) 
 - 
getPercentagepublic short getPercentage() 
 - 
runpublic void run() - Specified by:
- runin interface- java.lang.Runnable
- Overrides:
- runin class- java.lang.Thread
 
 - 
incrementpublic void increment() 
 - 
incrementpublic void increment(double dIncrememt) 
 - 
finishedpublic void finished() 
 - 
getRemainingTimepublic java.lang.String getRemainingTime() 
 - 
elapsedpublic java.lang.String elapsed() Get a string summarising the processing/remaining time in minutes and seconds.
 - 
longToTextpublic static java.lang.String longToText(long timems) 
 
- 
 
-