Class MCRCountingDNBURNGenerator


public abstract class MCRCountingDNBURNGenerator extends MCRDNBURNGenerator
A Generator which helps to generate a URN with a counter inside.
  • Method Details

    • readCountFromDatabase

      protected AtomicInteger readCountFromDatabase(String countPattern)
    • getCount

      public final int getCount(String pattern)
      Gets the count for a specific pattern and increase the internal counter. If there is no internal counter it will look into the Database and detect the highest count with the pattern.
      Parameters:
      pattern - a reg exp pattern which will be used to detect the highest count. The first group is the count. e.G. [0-9]+-mods-2017-([0-9][0-9][0-9][0-9])-[0-9] will match 31-mods-2017-0003-3 and the returned count will be 4 (3+1).
      Returns:
      the next count