Package randoop.output
Class NameGenerator
- java.lang.Object
-
- randoop.output.NameGenerator
-
public class NameGenerator extends Object
A NameGenerator generates a sequence of names as strings in the form "prefix"+i for integer i. Pads the counter with zeros to ensure a minimum number of digits determined by field digits.
-
-
Constructor Summary
Constructors Constructor Description NameGenerator(@Identifier String prefix)
Generates names without 0-padding on counter.NameGenerator(@Identifier 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 forlastValue
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Identifier String
next()
Return a new gensym (unique identifier).
-
-
-
Field Detail
-
counter
private int counter
The number to use for the next name to generate.
-
format
private String format
The format string to generate a name; takes one integer parameter.
-
-
Constructor Detail
-
NameGenerator
public NameGenerator(@Identifier 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 forlastValue
.- Parameters:
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 padding
-
NameGenerator
public NameGenerator(@Identifier String prefix)
Generates names without 0-padding on counter.- Parameters:
prefix
- is a string to be used as a prefix for all names generated
-
-
Method Detail
-
next
public @Identifier String next()
Return a new gensym (unique identifier).- Returns:
- the next identifier in the sequence produced by this
-
-