org.compass.core.id
Class UUIDGenerator

java.lang.Object
  extended by org.compass.core.id.UUIDGenerator
All Implemented Interfaces:
IdentifierGenerator

public class UUIDGenerator
extends Object
implements IdentifierGenerator

Author:
kimchy

Constructor Summary
UUIDGenerator()
           
 
Method Summary
protected  String format(int intval)
           
protected  String format(short shortval)
           
 Serializable generate()
           
protected  short getCount()
          Unique in a millisecond for this JVM instance (unless there are > Short.MAX_VALUE instances created in a millisecond)
protected  short getHiTime()
          Unique down to millisecond
protected  int getIP()
          Unique in a local network
protected  int getJVM()
          Unique across JVMs on this machine (unless they load this class in the same quater second - very unlikely)
protected  int getLoTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UUIDGenerator

public UUIDGenerator()
Method Detail

getJVM

protected int getJVM()
Unique across JVMs on this machine (unless they load this class in the same quater second - very unlikely)


getCount

protected short getCount()
Unique in a millisecond for this JVM instance (unless there are > Short.MAX_VALUE instances created in a millisecond)


getIP

protected int getIP()
Unique in a local network


getHiTime

protected short getHiTime()
Unique down to millisecond


getLoTime

protected int getLoTime()

format

protected String format(int intval)

format

protected String format(short shortval)

generate

public Serializable generate()
Specified by:
generate in interface IdentifierGenerator


Copyright (c) 2004-2008 The Compass Project.