|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.id.AbstractLongIdentifierGenerator
org.apache.commons.id.serial.LongGenerator
public class LongGenerator
LongGenerator is an Identifier Generator
that generates an incrementing number as a Long object.
If the wrap argument passed to the constructor is set to
true, the sequence will wrap, returning negative values when
Long.MAX_VALUE reached; otherwise an IllegalStateException
will be thrown.
| Constructor Summary | |
|---|---|
LongGenerator(boolean wrap,
long initialValue)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
isWrap()
Getter for property wrap. |
java.lang.Long |
nextLongIdentifier()
Gets the next identifier in the sequence. |
void |
setWrap(boolean wrap)
Sets the wrap property. |
| Methods inherited from class org.apache.commons.id.AbstractLongIdentifierGenerator |
|---|
maxValue, minValue, nextIdentifier |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LongGenerator(boolean wrap,
long initialValue)
wrap - should the factory wrap when it reaches the maximum
long value (or throw an exception)initialValue - the initial long value to start at| Method Detail |
|---|
public boolean isWrap()
true if this generator is set up to wrap.public void setWrap(boolean wrap)
wrap - value for the wrap propertypublic java.lang.Long nextLongIdentifier()
LongIdentifierGenerator
nextLongIdentifier in interface LongIdentifierGeneratornextLongIdentifier in class AbstractLongIdentifierGenerator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||