public final class NewVariables
extends java.lang.Object
Constructor and Description |
---|
NewVariables() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
newVariable(java.lang.String var,
java.util.Collection<java.lang.String> used)
Compute a new variable name derived from var that does not occur in used.
|
static java.lang.String[] |
newVariables(VariableSymbol[] vars,
java.lang.String suffix,
java.util.Collection<java.lang.String> used)
Compute unique and unused variable names.
|
public static java.lang.String[] newVariables(VariableSymbol[] vars, java.lang.String suffix, java.util.Collection<java.lang.String> used)
vars
- a sequence of variables that are candidates for the result.suffix
- a suffix to be added to variable name.used
- a collection of already used (and thus forbidden) names
(may be null, then denotes the empty set).public static java.lang.String newVariable(java.lang.String var, java.util.Collection<java.lang.String> used)
var
- the name from which the result is derived.used
- a set of forbidden name.