public class NameGenerator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private int |
counter
The number to use for the next name to generate.
|
private java.lang.String |
format
The format string to generate a name; takes one integer parameter.
|
| Constructor and Description |
|---|
NameGenerator(@Identifier java.lang.String prefix)
Generates names without 0-padding on counter.
|
NameGenerator(@Identifier java.lang.String prefix,
int initialValue,
int lastValue)
Creates an instance that generates names beginning with prefix, counts starting at the
initialValue, and 0-padded to enough digits for
lastValue. |
| Modifier and Type | Method and Description |
|---|---|
@Identifier java.lang.String |
next()
Return a new gensym (unique identifier).
|
private int counter
private java.lang.String format
public NameGenerator(@Identifier java.lang.String prefix,
int initialValue,
int lastValue)
lastValue.prefix - a string to be used as the prefix for all generated namesinitialValue - integer starting value for name counterlastValue - the last expected number, to determine 0-padding; 0 for no paddingpublic NameGenerator(@Identifier java.lang.String prefix)
prefix - is a string to be used as a prefix for all names generated