|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.util.ID64Generator
public class ID64Generator
A singleton class that generates a unique ID based on the millisecond timestamp
value returned by System.currentTimeMillis() minus the offset
from the Java epoch (midnight of January 1st, 1970) to the millenium, converted
to a base 64 value. This is guaranteed to be unique within the JVM, as the
generator will wait until the next millisecond before creating the next value
if queried faster than one millisecond.
Implements the TM4J IDGenerator API.
IDGenerator idg = ID64Generator.getInstance();
String id = idg.getID();
IDGenerator| Field Summary | |
|---|---|
static long |
MILLENIUM_MILLIS
The number of milliseconds from the Java 'epoch' (Jan 1, 1970 at midnight) through the beginning of the millenium (Jan 1, 2000 at midnight). |
| Method Summary | |
|---|---|
String |
getID()
Return a unique ID. |
static ID64Generator |
getInstance()
Returns the single instance of this class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long MILLENIUM_MILLIS
| Method Detail |
|---|
public String getID()
getID in interface IDGeneratorpublic static ID64Generator getInstance()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||