Class IdGenerator

  • All Implemented Interfaces:
    java.io.Serializable

    public class IdGenerator
    extends java.lang.Object
    implements java.io.Serializable
    Generate names for any kind of object.

    Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version Mar 4, 2016
    Author:
    Peter Knoppers
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      IdGenerator​(java.lang.String baseName)
      Construct a new IdGenerator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String nextId()
      Generate an id.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IdGenerator

        public IdGenerator​(java.lang.String baseName)
        Construct a new IdGenerator.
        Parameters:
        baseName - String; all generated names start with this string
    • Method Detail

      • nextId

        public final java.lang.String nextId()
        Generate an id.
        Returns:
        String; the generated id
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object