Class StaticProperty

java.lang.Object
com.oracle.truffle.api.staticobject.StaticProperty
Direct Known Subclasses:
DefaultStaticProperty

public abstract class StaticProperty extends Object
StaticProperty objects represent the mapping between property identifiers and storage locations within static objects.

Users of the Static Object Model can define custom subtypes of StaticProperty or use DefaultStaticProperty, a trivial default implementation. In both cases, static properties must be registered to a StaticShape.Builder using StaticShape.Builder.property(StaticProperty, Class, boolean). Then, after allocating a StaticShape instance with one of the StaticShape.Builder.build() methods and allocating a static object using the factory class provided by StaticShape.getFactory(), users can call the accessor methods defined in StaticProperty to get and set property values stored in a static object instance.

A StaticProperty instance can be added to only one StaticShape.Builder. StaticProperty instances registered to the same StaticShape.Builder must have a unique id for that builder.

Since:
21.3.0
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor for subclasses.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    compareAndExchangeBoolean(Object obj, boolean expect, boolean update)
    Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
    final byte
    compareAndExchangeByte(Object obj, byte expect, byte update)
    Atomically sets the byte value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
    final char
    compareAndExchangeChar(Object obj, char expect, char update)
    Atomically sets the char value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value , == the expected value.
    final double
    compareAndExchangeDouble(Object obj, double expect, double update)
    Atomically sets the double value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
    final float
    compareAndExchangeFloat(Object obj, float expect, float update)
    Atomically sets the float value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
    final int
    compareAndExchangeInt(Object obj, int expect, int update)
    Atomically sets the int value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
    final long
    compareAndExchangeLong(Object obj, long expect, long update)
    Atomically sets the long value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
    final Object
    Atomically sets the Object value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value , == the expected value.
    final short
    compareAndExchangeShort(Object obj, short expect, short update)
    Atomically sets the short value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
    final boolean
    compareAndSwapBoolean(Object obj, boolean expect, boolean update)
    Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapByte(Object obj, byte expect, byte update)
    Atomically sets the byte value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapChar(Object obj, char expect, char update)
    Atomically sets the char value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapDouble(Object obj, double expect, double update)
    Atomically sets the double value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapFloat(Object obj, float expect, float update)
    Atomically sets the float value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapInt(Object obj, int expect, int update)
    Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapLong(Object obj, long expect, long update)
    Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapObject(Object obj, Object expect, Object update)
    Atomically sets the Object value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final boolean
    compareAndSwapShort(Object obj, short expect, short update)
    Atomically sets the short value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
    final int
    getAndAddInt(Object obj, int delta)
    Atomically adds the given value to the current int value represented by this StaticProperty and stored in the specified static object.
    final long
    getAndAddLong(Object obj, long delta)
    Atomically adds the given value to the current long value represented by this StaticProperty and stored in the specified static object.
    final int
    getAndSetInt(Object obj, int value)
    Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.
    final long
    getAndSetLong(Object obj, long value)
    Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.
    final Object
    Atomically sets the Object value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.
    final boolean
    Returns the boolean value represented by this StaticProperty and stored in the specified static object.
    final boolean
    Returns the boolean value represented by this StaticProperty and stored in the specified static object.
    final byte
    Returns the byte value represented by this StaticProperty and stored in the specified static object.
    final byte
    Returns the byte value represented by this StaticProperty and stored in the specified static object.
    final char
    Returns the char value represented by this StaticProperty and stored in the specified static object.
    final char
    Returns the char value represented by this StaticProperty and stored in the specified static object.
    final double
    Returns the double value represented by this StaticProperty and stored in the specified static object.
    final double
    Returns the double value represented by this StaticProperty and stored in the specified static object.
    final float
    Returns the float value represented by this StaticProperty and stored in the specified static object.
    final float
    Returns the float value represented by this StaticProperty and stored in the specified static object.
    protected abstract String
    StaticProperty instances must have a String identifier that is unique and constant for that shape.
    final int
    Returns the int value represented by this StaticProperty and stored in the specified static object.
    final int
    Returns the int value represented by this StaticProperty and stored in the specified static object.
    final long
    Returns the long value represented by this StaticProperty and stored in the specified static object.
    final long
    Returns the long value represented by this StaticProperty and stored in the specified static object.
    final Object
    Returns the Object value represented by this StaticProperty and stored in the specified static object.
    final Object
    Returns the Object value represented by this StaticProperty and stored in the specified static object.
    final short
    Returns the short value represented by this StaticProperty and stored in the specified static object.
    final short
    Returns the short value represented by this StaticProperty and stored in the specified static object.
    final void
    setBoolean(Object obj, boolean value)
    Sets the boolean value represented by this StaticProperty and stored in the specified static object.
    final void
    setBooleanVolatile(Object obj, boolean value)
    Sets the boolean value represented by this StaticProperty and stored in the specified static object.
    final void
    setByte(Object obj, byte value)
    Sets the byte value represented by this StaticProperty and stored in the specified static object.
    final void
    setByteVolatile(Object obj, byte value)
    Sets the byte value represented by this StaticProperty and stored in the specified static object.
    final void
    setChar(Object obj, char value)
    Sets the char value represented by this StaticProperty and stored in the specified static object.
    final void
    setCharVolatile(Object obj, char value)
    Sets the char value represented by this StaticProperty and stored in the specified static object.
    final void
    setDouble(Object obj, double value)
    Sets the double value represented by this StaticProperty and stored in the specified static object.
    final void
    setDoubleVolatile(Object obj, double value)
    Sets the double value represented by this StaticProperty and stored in the specified static object.
    final void
    setFloat(Object obj, float value)
    Sets the float value represented by this StaticProperty and stored in the specified static object.
    final void
    setFloatVolatile(Object obj, float value)
    Sets the float value represented by this StaticProperty and stored in the specified static object.
    final void
    setInt(Object obj, int value)
    Sets the int value represented by this StaticProperty and stored in the specified static object.
    final void
    setIntVolatile(Object obj, int value)
    Sets the int value represented by this StaticProperty and stored in the specified static object.
    final void
    setLong(Object obj, long value)
    Sets the long value represented by this StaticProperty and stored in the specified static object.
    final void
    setLongVolatile(Object obj, long value)
    Sets the long value represented by this StaticProperty and stored in the specified static object.
    final void
    setObject(Object obj, Object value)
    Sets the Object value represented by this StaticProperty and stored in the specified static object.
    final void
    Sets the Object value represented by this StaticProperty and stored in the specified static object.
    final void
    setShort(Object obj, short value)
    Sets the short value represented by this StaticProperty and stored in the specified static object.
    final void
    setShortVolatile(Object obj, short value)
    Sets the short value represented by this StaticProperty and stored in the specified static object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StaticProperty

      protected StaticProperty()
      Constructor for subclasses.
      Since:
      21.3.0
  • Method Details

    • getId

      protected abstract String getId()
      StaticProperty instances must have a String identifier that is unique and constant for that shape. Subtypes of StaticProperty must make sure that the value returned by this method is constant in time.
      Returns:
      the static property identifier
      Since:
      21.3.0
    • getObject

      public final Object getObject(Object obj)
      Returns the Object value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is primitive, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getObjectVolatile

      public final Object getObjectVolatile(Object obj)
      Returns the Object value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is primitive, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setObject

      public final void setObject(Object obj, Object value)
      Sets the Object value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not assignable from the type of value, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setObjectVolatile

      public final void setObjectVolatile(Object obj, Object value)
      Sets the Object value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not assignable from the type of value, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapObject

      public final boolean compareAndSwapObject(Object obj, Object expect, Object update)
      Atomically sets the Object value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not assignable from the type of value, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getAndSetObject

      public final Object getAndSetObject(Object obj, Object value)
      Atomically sets the Object value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.
      Parameters:
      obj - the static object that stores the static property value
      value - the new value
      Returns:
      the previous value
      Throws:
      IllegalArgumentException - if the static property type is not assignable from the type of value, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeObject

      public final Object compareAndExchangeObject(Object obj, Object expect, Object update)
      Atomically sets the Object value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value , == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not assignable from the type of value, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getBoolean

      public final boolean getBoolean(Object obj)
      Returns the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the boolean class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getBooleanVolatile

      public final boolean getBooleanVolatile(Object obj)
      Returns the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the boolean class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setBoolean

      public final void setBoolean(Object obj, boolean value)
      Sets the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the boolean class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setBooleanVolatile

      public final void setBooleanVolatile(Object obj, boolean value)
      Sets the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the boolean class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapBoolean

      public final boolean compareAndSwapBoolean(Object obj, boolean expect, boolean update)
      Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the boolean class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeBoolean

      public final boolean compareAndExchangeBoolean(Object obj, boolean expect, boolean update)
      Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not the boolean class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getByte

      public final byte getByte(Object obj)
      Returns the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the byte class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getByteVolatile

      public final byte getByteVolatile(Object obj)
      Returns the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the byte class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setByte

      public final void setByte(Object obj, byte value)
      Sets the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the byte class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setByteVolatile

      public final void setByteVolatile(Object obj, byte value)
      Sets the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the byte class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapByte

      public final boolean compareAndSwapByte(Object obj, byte expect, byte update)
      Atomically sets the byte value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the byte class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeByte

      public final byte compareAndExchangeByte(Object obj, byte expect, byte update)
      Atomically sets the byte value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not the byte class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getChar

      public final char getChar(Object obj)
      Returns the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the char class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getCharVolatile

      public final char getCharVolatile(Object obj)
      Returns the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the char class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setChar

      public final void setChar(Object obj, char value)
      Sets the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the char class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setCharVolatile

      public final void setCharVolatile(Object obj, char value)
      Sets the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the char class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapChar

      public final boolean compareAndSwapChar(Object obj, char expect, char update)
      Atomically sets the char value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the char class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeChar

      public final char compareAndExchangeChar(Object obj, char expect, char update)
      Atomically sets the char value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value , == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not the char class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getDouble

      public final double getDouble(Object obj)
      Returns the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the double class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getDoubleVolatile

      public final double getDoubleVolatile(Object obj)
      Returns the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the double class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setDouble

      public final void setDouble(Object obj, double value)
      Sets the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the double class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setDoubleVolatile

      public final void setDoubleVolatile(Object obj, double value)
      Sets the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the double class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapDouble

      public final boolean compareAndSwapDouble(Object obj, double expect, double update)
      Atomically sets the double value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the double class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeDouble

      public final double compareAndExchangeDouble(Object obj, double expect, double update)
      Atomically sets the double value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not the double class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getFloat

      public final float getFloat(Object obj)
      Returns the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the float class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getFloatVolatile

      public final float getFloatVolatile(Object obj)
      Returns the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the float class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setFloat

      public final void setFloat(Object obj, float value)
      Sets the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the float class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setFloatVolatile

      public final void setFloatVolatile(Object obj, float value)
      Sets the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the float class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapFloat

      public final boolean compareAndSwapFloat(Object obj, float expect, float update)
      Atomically sets the float value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the float class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeFloat

      public final float compareAndExchangeFloat(Object obj, float expect, float update)
      Atomically sets the float value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not the float class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getInt

      public final int getInt(Object obj)
      Returns the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the int class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getIntVolatile

      public final int getIntVolatile(Object obj)
      Returns the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the int class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setInt

      public final void setInt(Object obj, int value)
      Sets the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the int class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setIntVolatile

      public final void setIntVolatile(Object obj, int value)
      Sets the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the int class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapInt

      public final boolean compareAndSwapInt(Object obj, int expect, int update)
      Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the int class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeInt

      public final int compareAndExchangeInt(Object obj, int expect, int update)
      Atomically sets the int value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Since:
      21.3.0
    • getAndAddInt

      public final int getAndAddInt(Object obj, int delta)
      Atomically adds the given value to the current int value represented by this StaticProperty and stored in the specified static object.
      Parameters:
      obj - the static object that stores the static property value
      delta - the value to add
      Returns:
      the previous value
      Throws:
      IllegalArgumentException - if the static property type is not the int class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getAndSetInt

      public final int getAndSetInt(Object obj, int value)
      Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.
      Parameters:
      obj - the static object that stores the static property value
      value - the new value
      Returns:
      the previous value
      Throws:
      IllegalArgumentException - if the static property type is not the int class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getLong

      public final long getLong(Object obj)
      Returns the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getLongVolatile

      public final long getLongVolatile(Object obj)
      Returns the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setLong

      public final void setLong(Object obj, long value)
      Sets the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setLongVolatile

      public final void setLongVolatile(Object obj, long value)
      Sets the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapLong

      public final boolean compareAndSwapLong(Object obj, long expect, long update)
      Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeLong

      public final long compareAndExchangeLong(Object obj, long expect, long update)
      Atomically sets the long value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getAndAddLong

      public final long getAndAddLong(Object obj, long delta)
      Atomically adds the given value to the current long value represented by this StaticProperty and stored in the specified static object.
      Parameters:
      obj - the static object that stores the static property value
      delta - the value to add
      Returns:
      the previous value
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getAndSetLong

      public final long getAndSetLong(Object obj, long value)
      Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.
      Parameters:
      obj - the static object that stores the static property value
      value - the new value
      Returns:
      the previous value
      Throws:
      IllegalArgumentException - if the static property type is not the long class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getShort

      public final short getShort(Object obj)
      Returns the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the short class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • getShortVolatile

      public final short getShortVolatile(Object obj)
      Returns the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      Returns:
      the value of the static property stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the short class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setShort

      public final void setShort(Object obj, short value)
      Sets the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the short class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • setShortVolatile

      public final void setShortVolatile(Object obj, short value)
      Sets the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.
      Parameters:
      obj - the static object that stores the static property value
      value - the new static property value, to be stored in static object obj
      Throws:
      IllegalArgumentException - if the static property type is not the short class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndSwapShort

      public final boolean compareAndSwapShort(Object obj, short expect, short update)
      Atomically sets the short value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Throws:
      IllegalArgumentException - if the static property type is not the short class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0
    • compareAndExchangeShort

      public final short compareAndExchangeShort(Object obj, short expect, short update)
      Atomically sets the short value represented by this StaticProperty and stored in the specified static object to newValue if the current value, referred to as the witness value, == the expected value.
      Parameters:
      obj - the static object that stores the static property value
      expect - the expected value
      update - the new value
      Returns:
      the witness value, which will be the same as the expected value if successful
      Throws:
      IllegalArgumentException - if the static property type is not the short class, or obj does not have a StaticShape compatible with this static property
      Since:
      21.3.0