Class NameGenerator


  • public class NameGenerator
    extends Object
    Generates unique names.

    Also keeps track of how many times each given name has been used in this program, so that a new occurrence of a name can be given a fresh ordinal.

    • Constructor Detail

      • NameGenerator

        public NameGenerator()
    • Method Detail

      • get

        public String get()
        Generates a name that is unique in this program.
      • inc

        public int inc​(String name)
        Returns the number of times that "name" has been used for a variable.