Class ComponentSuffixGenerator


  • public class ComponentSuffixGenerator
    extends java.lang.Object
    Utility class that maintains stacked counters which can be used as suffixes for uniquely identifying names.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void endComponentStack()
      Ends a component stack
      java.lang.String getSuffix​(java.lang.String componentName)
      Gets the suffix for a component name.
      void reset()
      Resets the internal structures for maintaining the component stacks and suffixes
      void startComponentStack()
      Creates a new component stack for hierarchical suffixing.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ComponentSuffixGenerator

        public ComponentSuffixGenerator()
    • Method Detail

      • getSuffix

        public java.lang.String getSuffix​(java.lang.String componentName)
        Gets the suffix for a component name. The suffix scheme is to use an incrementing counter.
        Parameters:
        componentName - The name of the component the suffix for which is desired
        Returns:
        The suffix that uniquely identifies the component. If the api is consecutively called for the same component name, an incremented suffix value will be observed.
      • startComponentStack

        public void startComponentStack()
        Creates a new component stack for hierarchical suffixing. Same component names may bear the same suffix given that they are in different hierarchy levels
      • endComponentStack

        public void endComponentStack()
        Ends a component stack
      • reset

        public void reset()
        Resets the internal structures for maintaining the component stacks and suffixes