|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.betwixt.io.id.AbstractIDGenerator
org.apache.commons.betwixt.io.id.SequentialIDGenerator
public final class SequentialIDGenerator
Generates ID's in numeric sequence.
A simple counter is used.
Every time that nextIdImpl() is called,
this counter is incremented.
By default, the counter starts at zero.
A user can set the initial value by using the
SequentialIDGenerator(int start) constructor.
| Constructor Summary | |
|---|---|
SequentialIDGenerator()
Base constructor. |
|
SequentialIDGenerator(int start)
Constructor sets the start value for the counter. |
|
| Method Summary | |
|---|---|
int |
getCount()
Gets the current counter value |
java.lang.String |
nextIdImpl()
Increment counter and then return value. |
| Methods inherited from class org.apache.commons.betwixt.io.id.AbstractIDGenerator |
|---|
getLastId, nextId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SequentialIDGenerator()
public SequentialIDGenerator(int start)
Note since the counter increments
before returning the next value,
first ID generated will be one more
than the given start parameter.
start - start the counting at this value| Method Detail |
|---|
public java.lang.String nextIdImpl()
nextIdImpl in class AbstractIDGeneratorpublic int getCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||