Interface Counter


  • public interface Counter
    Distributed atomic counter.
    Author:
    javaito
    • Method Summary

      Modifier and Type Method Description
      java.lang.Long getAndAdd()
      This method return the last number and add one unit to the counter in one atomic operation over the cloud.
      java.lang.Long getAndAdd​(java.lang.Long offset)
      This method return the last number and add the counter in one atomic operation over the cloud.
    • Method Detail

      • getAndAdd

        java.lang.Long getAndAdd()
        This method return the last number and add one unit to the counter in one atomic operation over the cloud.
        Returns:
        Return the last value of the counter before increase.
      • getAndAdd

        java.lang.Long getAndAdd​(java.lang.Long offset)
        This method return the last number and add the counter in one atomic operation over the cloud.
        Parameters:
        offset - Offset to increment the counter value.
        Returns:
        Return the last value of the counter before increase.