/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, E newValue) { unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); }
/** * Gets the current value at position {@code i}. * * @param i the index * @return the current value */ public final E get(int i) { return getRaw(checkedByteOffset(i)); }
/** * Eventually sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value * @since 1.6 */ public final void lazySet(int i, E newValue) { unsafe.putOrderedObject(array, checkedByteOffset(i), newValue); }
/** * Atomically sets the element at position {@code i} to the given * updated value if the current value {@code ==} the expected value. * * @param i the index * @param expect the expected value * @param update the new value * @return true if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(int i, E expect, E update) { return compareAndSetRaw(checkedByteOffset(i), expect, update); }
/** * Atomically sets the element at position {@code i} to the given * value and returns the old value. * * @param i the index * @param newValue the new value * @return the previous value */ public final E getAndSet(int i, E newValue) { long offset = checkedByteOffset(i); while (true) { E current = getRaw(offset); if (compareAndSetRaw(offset, current, newValue)) return current; } }
/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, E newValue) { unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); }
/** * Eventually sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value * @since 1.6 */ public final void lazySet(int i, E newValue) { unsafe.putOrderedObject(array, checkedByteOffset(i), newValue); }
/** * Gets the current value at position {@code i}. * * @param i the index * @return the current value */ public final E get(int i) { return getRaw(checkedByteOffset(i)); }
/** * Gets the current value at position {@code i}. * * @param i the index * @return the current value */ public final E get(int i) { return getRaw(checkedByteOffset(i)); }
/** * Gets the current value at position {@code i}. * * @param i the index * @return the current value */ public final E get(int i) { return getRaw(checkedByteOffset(i)); }
/** * Eventually sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value * @since 1.6 */ public final void lazySet(int i, E newValue) { unsafe.putOrderedObject(array, checkedByteOffset(i), newValue); }
/** * Gets the current value at position {@code i}. * * @param i the index * @return the current value */ public final E get(int i) { return getRaw(checkedByteOffset(i)); }
/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, E newValue) { unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); }
/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, E newValue) { unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); }
/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, E newValue) { unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); }
/** * Gets the current value at position {@code i}. * * @param i the index * @return the current value */ public final E get(int i) { return getRaw(checkedByteOffset(i)); }
/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, E newValue) { unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); }
/** * Eventually sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value * @since 1.6 */ public final void lazySet(int i, E newValue) { unsafe.putOrderedObject(array, checkedByteOffset(i), newValue); }
/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, E newValue) { unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); }
/** * Eventually sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value * @since 1.6 */ public final void lazySet(int i, E newValue) { unsafe.putOrderedObject(array, checkedByteOffset(i), newValue); }