scale.common
Class UniqueName

java.lang.Object
  extended by scale.common.UniqueName

public class UniqueName
extends java.lang.Object

This class implements a unique name generator.

$Id: UniqueName.java,v 1.17 2007-01-04 16:58:39 burrill Exp $

Copyright 2006 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Constructor Summary
UniqueName(java.lang.String seed)
           
 
Method Summary
 java.lang.String genName()
          Return a unique name.
 java.lang.String getNextName()
          Return the next name that will be generated.
 int getNextNumber()
          Return the next number that will be used in the next generated name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueName

public UniqueName(java.lang.String seed)
Parameters:
seed - the name prefix to be used for generated names.
Method Detail

genName

public java.lang.String genName()
Return a unique name. Generate a string of the form pppnnnn where ppp is the seed specified when the UniqueName object was created and nnn is a unique integer.


getNextName

public java.lang.String getNextName()
Return the next name that will be generated. This is useful for debugging. To get a name for use in generated code use genName.


getNextNumber

public int getNextNumber()
Return the next number that will be used in the next generated name. This is useful for debugging. To get a name for use in generated code use genName.