|
Watchmaker Framework API (Version 0.6.2) |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.uncommons.util.id.CompositeIDSource
public final class CompositeIDSource
Thread-safe source for partitioned unique IDs. A single instance of this class represents a single 'partition' in the space of possible IDs. By creating multiple instances with different discriminators, multiple entities may generate globally unique IDs independently.
Any given instance of this class may generate a maximum of 2^31 unique values (the most significant 4 bytes are fixed and the least significant 4 bytes vary in sequence).
| Constructor Summary | |
|---|---|
CompositeIDSource(int topPart)
|
|
| Method Summary | |
|---|---|
Long |
nextID()
Implementing classes are responsible for synchronization if concurrent invocations of this method are required. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeIDSource(int topPart)
topPart - The most significant 32 bits to use for the 64-bit IDs generated
by this source. All IDs generated by this source will have the same top 4 bytes.| Method Detail |
|---|
public Long nextID()
nextID in interface IDSource<Long>
|
Watchmaker Framework API (Version 0.6.2) |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||