ProgramixGenericLib v5.0.1

Class DateTools.AcceleratedTimeSource

  extended by com.programix.time.DateTools.AcceleratedTimeSource
All Implemented Interfaces:
Enclosing class:

public static class DateTools.AcceleratedTimeSource
extends Object
implements DateTools.TimeSource

Used to speed forward from 'now' to a specified time in the future. After the speeding gets to the end time, the pace of time returns to normal.

Paul Hyde

Constructor Summary
DateTools.AcceleratedTimeSource(double speedFactor, long pretendEndTime)
Method Summary
 long getTime()
          Returns the number of milliseconds since 1970-01-01.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DateTools.AcceleratedTimeSource(double speedFactor,
                                       long pretendEndTime)
Method Detail


public long getTime()
Description copied from interface: DateTools.TimeSource
Returns the number of milliseconds since 1970-01-01. Some implementations may choose to not use System.currentTimeMillis() as the source! This flexibility allows a VM-wide offset or time acceleration to be implemented. Keep in mind that if time is accelerated, wait(long msTimeout) and Thread.sleep(long msDuration) times requested throughout the VM will likely last too long.

Specified by:
getTime in interface DateTools.TimeSource

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.