Package com.qfs.chunk

Interface IConcurrentChunkInteger

    • Method Detail

      • writeIntVolatile

        void writeIntVolatile​(int position,
                              int value)
        Writes an int primitive value in this chunk in a volatile fashion.
        Parameters:
        position - the position to write the value to
        value - the value to write
        See Also:
        IChunkInteger.writeInt(int, int)
      • readIntVolatile

        int readIntVolatile​(int position)
        Reads an int primitive value from this chunk in a volatile fashion.

        An exception will be thrown if the value is not of the right type.

        Parameters:
        position - the position to read the value from
        Returns:
        the value stored at the given position
        See Also:
        IChunkInteger.readInt(int)
      • compareAndSet

        boolean compareAndSet​(int position,
                              int expectedValue,
                              int updatedValue)
        Atomically sets the given position of this chunk to the given updated value if the current value stored at this position equals the expected value.
        Parameters:
        position - the position to update
        expectedValue - the expected value
        updatedValue - the new value
        Returns:
        true if successful, or false if the actual value was not equal to the expected value