public final class SequentialIDGenerator extends AbstractIDGenerator
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 and Description |
|---|
SequentialIDGenerator()
Base constructor.
|
SequentialIDGenerator(int start)
Constructor sets the start value for the counter.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCount()
Gets the current counter value
|
String |
nextIdImpl()
Increment counter and then return value.
|
getLastId, nextIdpublic 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 valuepublic String nextIdImpl()
nextIdImpl in class AbstractIDGeneratorpublic int getCount()
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.