Class IDGenerator

java.lang.Object
org.apache.uima.caseditor.editor.util.IDGenerator

public class IDGenerator extends Object

The IDGenerator generate unique IDs.

Attention: The maximal number of generateable IDs is Long.MAX_VALUE. If there are more than Long.MAX_VALUE calls to nextUniqueID() an IllegalStateException will be thrown.

  • Method Details

    • nextUniqueID

      public byte[] nextUniqueID()
      Retrieve the next unique ID.
      Returns:
      - the unique id
      Throws:
      IllegalStateException - - if there are more than Long.MAX_VALUE calls to IDGenerator.nextUniqueID()
    • getInstance

      public static IDGenerator getInstance()
      Retrieves the only instance of the IDGenerator.
      Returns:
      - the instance of the IDGenerator