Class COUNTER.VersionedValue

  • Enclosing class:
    COUNTER

    protected static class COUNTER.VersionedValue
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long value  
      protected long version  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected VersionedValue​(long value)  
      protected VersionedValue​(long value, long version)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected long[] addAndGet​(long num)
      num == 0 --> GET
      protected long[] compareAndSet​(long expected, long update)  
      protected long[] set​(long value)  
      java.lang.String toString()  
      protected void updateIfBigger​(long value, long version)
      Sets the value only if the version argument is greater than the own version
      • Methods inherited from class java.lang.Object

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

      • value

        protected long value
      • version

        protected long version
    • Constructor Detail

      • VersionedValue

        protected VersionedValue​(long value)
      • VersionedValue

        protected VersionedValue​(long value,
                                 long version)
    • Method Detail

      • addAndGet

        protected long[] addAndGet​(long num)
        num == 0 --> GET
      • set

        protected long[] set​(long value)
      • compareAndSet

        protected long[] compareAndSet​(long expected,
                                       long update)
      • updateIfBigger

        protected void updateIfBigger​(long value,
                                      long version)
        Sets the value only if the version argument is greater than the own version
      • toString

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