Class StaticProperty
- Direct Known Subclasses:
DefaultStaticProperty
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 -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancompareAndExchangeBoolean(Object obj, boolean expect, boolean update) Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.final bytecompareAndExchangeByte(Object obj, byte expect, byte update) Atomically sets the byte value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.final charcompareAndExchangeChar(Object obj, char expect, char update) Atomically sets the char value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value ,==the expected value.final doublecompareAndExchangeDouble(Object obj, double expect, double update) Atomically sets the double value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.final floatcompareAndExchangeFloat(Object obj, float expect, float update) Atomically sets the float value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.final intcompareAndExchangeInt(Object obj, int expect, int update) Atomically sets the int value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.final longcompareAndExchangeLong(Object obj, long expect, long update) Atomically sets the long value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.final ObjectcompareAndExchangeObject(Object obj, Object expect, Object update) Atomically sets theObjectvalue represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value ,==the expected value.final shortcompareAndExchangeShort(Object obj, short expect, short update) Atomically sets the short value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.final booleancompareAndSwapBoolean(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 booleancompareAndSwapByte(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 booleancompareAndSwapChar(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 booleancompareAndSwapDouble(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 booleancompareAndSwapFloat(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 booleancompareAndSwapInt(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 booleancompareAndSwapLong(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 booleancompareAndSwapObject(Object obj, Object expect, Object update) Atomically sets theObjectvalue represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==the expected value.final booleancompareAndSwapShort(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 intgetAndAddInt(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 longgetAndAddLong(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 intgetAndSetInt(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 longgetAndSetLong(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 ObjectgetAndSetObject(Object obj, Object value) Atomically sets theObjectvalue represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.final booleangetBoolean(Object obj) Returns the boolean value represented by this StaticProperty and stored in the specified static object.final booleangetBooleanVolatile(Object obj) Returns the boolean value represented by this StaticProperty and stored in the specified static object.final byteReturns the byte value represented by this StaticProperty and stored in the specified static object.final bytegetByteVolatile(Object obj) Returns the byte value represented by this StaticProperty and stored in the specified static object.final charReturns the char value represented by this StaticProperty and stored in the specified static object.final chargetCharVolatile(Object obj) Returns the char value represented by this StaticProperty and stored in the specified static object.final doubleReturns the double value represented by this StaticProperty and stored in the specified static object.final doublegetDoubleVolatile(Object obj) Returns the double value represented by this StaticProperty and stored in the specified static object.final floatReturns the float value represented by this StaticProperty and stored in the specified static object.final floatgetFloatVolatile(Object obj) Returns the float value represented by this StaticProperty and stored in the specified static object.protected abstract StringgetId()StaticProperty instances must have aStringidentifier that is unique and constant for that shape.final intReturns the int value represented by this StaticProperty and stored in the specified static object.final intgetIntVolatile(Object obj) Returns the int value represented by this StaticProperty and stored in the specified static object.final longReturns the long value represented by this StaticProperty and stored in the specified static object.final longgetLongVolatile(Object obj) Returns the long value represented by this StaticProperty and stored in the specified static object.final ObjectReturns theObjectvalue represented by this StaticProperty and stored in the specified static object.final ObjectgetObjectVolatile(Object obj) Returns theObjectvalue represented by this StaticProperty and stored in the specified static object.final shortReturns the short value represented by this StaticProperty and stored in the specified static object.final shortgetShortVolatile(Object obj) Returns the short value represented by this StaticProperty and stored in the specified static object.final voidsetBoolean(Object obj, boolean value) Sets the boolean value represented by this StaticProperty and stored in the specified static object.final voidsetBooleanVolatile(Object obj, boolean value) Sets the boolean value represented by this StaticProperty and stored in the specified static object.final voidSets the byte value represented by this StaticProperty and stored in the specified static object.final voidsetByteVolatile(Object obj, byte value) Sets the byte value represented by this StaticProperty and stored in the specified static object.final voidSets the char value represented by this StaticProperty and stored in the specified static object.final voidsetCharVolatile(Object obj, char value) Sets the char value represented by this StaticProperty and stored in the specified static object.final voidSets the double value represented by this StaticProperty and stored in the specified static object.final voidsetDoubleVolatile(Object obj, double value) Sets the double value represented by this StaticProperty and stored in the specified static object.final voidSets the float value represented by this StaticProperty and stored in the specified static object.final voidsetFloatVolatile(Object obj, float value) Sets the float value represented by this StaticProperty and stored in the specified static object.final voidSets the int value represented by this StaticProperty and stored in the specified static object.final voidsetIntVolatile(Object obj, int value) Sets the int value represented by this StaticProperty and stored in the specified static object.final voidSets the long value represented by this StaticProperty and stored in the specified static object.final voidsetLongVolatile(Object obj, long value) Sets the long value represented by this StaticProperty and stored in the specified static object.final voidSets theObjectvalue represented by this StaticProperty and stored in the specified static object.final voidsetObjectVolatile(Object obj, Object value) Sets theObjectvalue represented by this StaticProperty and stored in the specified static object.final voidSets the short value represented by this StaticProperty and stored in the specified static object.final voidsetShortVolatile(Object obj, short value) Sets the short value represented by this StaticProperty and stored in the specified static object.
-
Constructor Details
-
StaticProperty
protected StaticProperty()Constructor for subclasses.- Since:
- 21.3.0
-
-
Method Details
-
getId
-
getObject
Returns theObjectvalue 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getObjectVolatile
Returns theObjectvalue 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setObject
Sets theObjectvalue 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 valuevalue- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException- if the static property type is not assignable fromthe type of value, or obj does not have aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setObjectVolatile
Sets theObjectvalue 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 valuevalue- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException- if the static property type is not assignable fromthe type of value, or obj does not have aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapObject
Atomically sets theObjectvalue 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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 fromthe type of value, or obj does not have aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getAndSetObject
Atomically sets theObjectvalue 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 valuevalue- the new value- Returns:
- the previous value
- Throws:
IllegalArgumentException- if the static property type is not assignable fromthe type of value, or obj does not have aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeObject
Atomically sets theObjectvalue represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value ,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 fromthe type of value, or obj does not have aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getBoolean
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getBooleanVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setBoolean
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setBooleanVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapBoolean
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeBoolean
Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getByte
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getByteVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setByte
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setByteVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapByte
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeByte
Atomically sets the byte value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getChar
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getCharVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setChar
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setCharVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapChar
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeChar
Atomically sets the char value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value ,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getDouble
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getDoubleVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setDouble
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setDoubleVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapDouble
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeDouble
Atomically sets the double value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getFloat
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getFloatVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setFloat
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setFloatVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapFloat
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeFloat
Atomically sets the float value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getInt
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getIntVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setInt
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setIntVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapInt
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeInt
Atomically sets the int value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Since:
- 21.3.0
-
getAndAddInt
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 valuedelta- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getAndSetInt
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 valuevalue- the new value- Returns:
- the previous value
- Throws:
IllegalArgumentException- if the static property type is not the int class, or obj does not have aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getLong
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getLongVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setLong
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setLongVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapLong
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeLong
Atomically sets the long value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getAndAddLong
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 valuedelta- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getAndSetLong
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 valuevalue- the new value- Returns:
- the previous value
- Throws:
IllegalArgumentException- if the static property type is not the long class, or obj does not have aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getShort
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
getShortVolatile
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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setShort
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
setShortVolatile
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 valuevalue- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndSwapShort
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 valueexpect- the expected valueupdate- the new value- Returns:
trueif 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-
compareAndExchangeShort
Atomically sets the short value represented by this StaticProperty and stored in the specified static object tonewValueif the current value, referred to as the witness value,==the expected value.- Parameters:
obj- the static object that stores the static property valueexpect- the expected valueupdate- 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 aStaticShapecompatible with this static property- Since:
- 21.3.0
-