|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.powertac.common.IdGenerator
public class IdGenerator
Generates numeric ID values for domain types. ID values are of the form xA+B, where x is the multiplier, A is a prefix, and B is the value of a counter.
| Constructor Summary | |
|---|---|
IdGenerator()
|
|
| Method Summary | |
|---|---|
static long |
createId()
Generates a numeric ID as xA+B. |
static int |
getPrefix()
Returns the id prefix - needed for testing. |
static String |
getString(long id)
Converts ID value to String as A.B. |
static void |
recycle()
Recycles the generator. |
static void |
setPrefix(int value)
Each entity living in a separate process must have a different prefix value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IdGenerator()
| Method Detail |
|---|
public static long createId()
public static void setPrefix(int value)
public static int getPrefix()
public static String getString(long id)
public static void recycle()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||