Class IntWrapper.AtomicIntWrapper

java.lang.Object
ru.progrm_jarvis.javacommons.primitive.wrapper.IntWrapper.AtomicIntWrapper
All Implemented Interfaces:
Numeric, IntWrapper, PrimitiveWrapper<Integer>
Enclosing interface:
IntWrapper

public static final class IntWrapper.AtomicIntWrapper extends Object implements IntWrapper
IntWrapper implementation based on AtomicInteger.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • get

      public int get()
      Description copied from interface: IntWrapper
      Gets the value.
      Specified by:
      get in interface IntWrapper
      Returns:
      value
    • set

      public void set(int value)
      Description copied from interface: IntWrapper
      Sets the value.
      Specified by:
      set in interface IntWrapper
      Parameters:
      value - value to be set
    • getAndSet

      public int getAndSet(int newValue)
      Description copied from interface: IntWrapper
      Sets the value to the one given returning the previous one.
      Specified by:
      getAndSet in interface IntWrapper
      Parameters:
      newValue - value to be set
      Returns:
      previous value
    • getAndIncrement

      public int getAndIncrement()
      Description copied from interface: IntWrapper
      Gets the value after what it gets incremented.
      Specified by:
      getAndIncrement in interface IntWrapper
      Returns:
      value before increment
    • incrementAndGet

      public int incrementAndGet()
      Description copied from interface: IntWrapper
      Increments the value after what it is returned.
      Specified by:
      incrementAndGet in interface IntWrapper
      Returns:
      value after increment
    • getAndDecrement

      public int getAndDecrement()
      Description copied from interface: IntWrapper
      Gets the value after what it gets decremented.
      Specified by:
      getAndDecrement in interface IntWrapper
      Returns:
      value before decrement
    • decrementAndGet

      public int decrementAndGet()
      Description copied from interface: IntWrapper
      Decrements the value after what it is returned.
      Specified by:
      decrementAndGet in interface IntWrapper
      Returns:
      value after decrement
    • getAndAdd

      public int getAndAdd(int delta)
      Description copied from interface: IntWrapper
      Gets the value after what delta is added to it.
      Specified by:
      getAndAdd in interface IntWrapper
      Parameters:
      delta - the value which should be added to the current value
      Returns:
      value before addition
    • addAndGet

      public int addAndGet(int delta)
      Description copied from interface: IntWrapper
      Adds the delta to the value after what it is returned.
      Specified by:
      addAndGet in interface IntWrapper
      Parameters:
      delta - the value which should be added to the current value
      Returns:
      value after addition
    • getAndUpdate

      public int getAndUpdate(IntUnaryOperator updateFunction)
      Description copied from interface: IntWrapper
      Updates the current value using the specified function after what the new value is returned.
      Specified by:
      getAndUpdate in interface IntWrapper
      Parameters:
      updateFunction - function to be used for updating the value
      Returns:
      value before update
    • updateAndGet

      public int updateAndGet(IntUnaryOperator updateFunction)
      Description copied from interface: IntWrapper
      Gets the value after what it gets updated using the specified function.
      Specified by:
      updateAndGet in interface IntWrapper
      Parameters:
      updateFunction - function to be used for updating the value
      Returns:
      value after update
    • getAndAccumulate

      public int getAndAccumulate(int updateValue, IntBinaryOperator accumulatorFunction)
      Description copied from interface: IntWrapper
      Updates the current value using specified function and update value after what the new value is returned.
      Specified by:
      getAndAccumulate in interface IntWrapper
      Parameters:
      updateValue - update value (will be passed as the second function parameter)
      accumulatorFunction - function to be used for updating the value
      Returns:
      value before update
    • accumulateAndGet

      public int accumulateAndGet(int updateValue, IntBinaryOperator accumulatorFunction)
      Description copied from interface: IntWrapper
      Gets the value after what it gets updated using the specified function and update value.
      Specified by:
      accumulateAndGet in interface IntWrapper
      Parameters:
      updateValue - update value (will be passed as the second function parameter)
      accumulatorFunction - function to be used for updating the value
      Returns:
      value after update
    • byteValue

      public byte byteValue()
      Description copied from interface: Numeric
      Returns the value as byte.
      Specified by:
      byteValue in interface Numeric
      Returns:
      value as byte
    • shortValue

      public short shortValue()
      Description copied from interface: Numeric
      Returns the value as short.
      Specified by:
      shortValue in interface Numeric
      Returns:
      value as short
    • intValue

      public int intValue()
      Description copied from interface: Numeric
      Returns the value as int.
      Specified by:
      intValue in interface Numeric
      Returns:
      value as int
    • longValue

      public long longValue()
      Description copied from interface: Numeric
      Returns the value as long.
      Specified by:
      longValue in interface Numeric
      Returns:
      value as long
    • floatValue

      public float floatValue()
      Description copied from interface: Numeric
      Returns the value as float.
      Specified by:
      floatValue in interface Numeric
      Returns:
      value as float
    • doubleValue

      public double doubleValue()
      Description copied from interface: Numeric
      Returns the value as double.
      Specified by:
      doubleValue in interface Numeric
      Returns:
      value as double