|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.totem.util.IdGenerator
public class IdGenerator
IdGenerator is a singleton used to generate unique id. It uses the java.util.Random random number generator.
Creation date: 02-Feb-2005 11:05:40
Method Summary | |
---|---|
int |
generateIntId()
Return a int Id uniformely distributed between 0 and Integer.MAX_VALUE |
int |
generateIntId(int n)
Return a int Id uniformely distributed between 0 and n (exclusive) |
java.lang.String |
generateStringId(java.lang.String prefix)
Return a String id composed by the prefix given and a random number between 0 and Integer.MAX_VALUE |
static IdGenerator |
getInstance()
Get IdGenerator unique instance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static IdGenerator getInstance()
public int generateIntId()
public int generateIntId(int n)
n
- : max int Id
public java.lang.String generateStringId(java.lang.String prefix)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |