|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.csail.sdg.alloy4.UniqueNameGenerator
public final class UniqueNameGenerator
This generates unique names based on names provided by the caller.
Thread Safety: Safe.
Constructor Summary | |
---|---|
UniqueNameGenerator()
Construct a UniqueNameGenerator with a blank history. |
Method Summary | |
---|---|
void |
clear()
Clear the history of previously generated names. |
boolean |
hasSeen(java.lang.String name)
Queries whether the provided name has been "seen" or not. |
java.lang.String |
make(java.lang.String name)
Generate a unique name based on the input name. |
java.lang.String |
seen(java.lang.String name)
Regard the provided name as "seen". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UniqueNameGenerator()
Method Detail |
---|
public java.lang.String seen(java.lang.String name)
For convenience, it returns the argument as the return value.
public boolean hasSeen(java.lang.String name)
public void clear()
public java.lang.String make(java.lang.String name)
Specifically: if the name has not been generated/seen already by this generator, then it is returned as is. Otherwise, we append ' to it until the name becomes unique.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |