com.activequant.utils
Class UniqueTimeStampGenerator
java.lang.Object
com.activequant.utils.UniqueTimeStampGenerator
public class UniqueTimeStampGenerator
- extends Object
Utility class to generate unique date for market events.
The problem is that some feed sources do not supply milliseconds (Opentick's)
in the date field. Since AQ code depends on date to be unique within the
type and feed source, we need to fake millisecond part.
This object generates unique date by catching duplicates and
assigning milliseconds sequentially.
Optionally, it is possible to generate a timestamp from a number like
the number of milliseconds since unix epoch start.
History:
- [27.11.2007] Created (Mike Kroutikov)
- [26.09.2009] Adding generate(long) method (Ulrich Staudinger)
- Author:
- Mike Kroutikov, Ulrich Staudinger
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UniqueTimeStampGenerator
public UniqueTimeStampGenerator()
now
public TimeStamp now()
generate
public TimeStamp generate(Date input)
generate
public TimeStamp generate(long inputInMilliseconds)
Copyright © 2012 ActiveQuant GmbH. All Rights Reserved.