Package net.sf.ehcache.util
Class Timestamper
- java.lang.Object
-
- net.sf.ehcache.util.Timestamper
-
public final class Timestamper extends java.lang.ObjectGenerates increasing identifiers (in a single VM only). Not valid across multiple VMs. Yet, the identifier is based on time, so that the drifting across a cluster should not ever be large...- Author:
- Alex Snaps
-
-
Field Summary
Fields Modifier and Type Field Description static intBIN_DIGITSValue for left shifting System.currentTimeMillis, freeing some space for the counterstatic intONE_MSWhat is one milliseconds, based on "counter value reserved space", for this Timestamper
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longnext()Returns an increasing unique value based on theSystem.currentTimeMillis()with some additional reserved space for a counter.
-
-
-
Method Detail
-
next
public static long next()
Returns an increasing unique value based on theSystem.currentTimeMillis()with some additional reserved space for a counter.- Returns:
- uniquely & increasing value
- See Also:
BIN_DIGITS
-
-