Interface Field
-
Method Summary
Modifier and TypeMethodDescriptioncompareAndExchange
(Object expectedValue, Object newValue) compareAndExchangeAcquire
(Object expectedValue, Object newValue) compareAndExchangeRelease
(Object expectedValue, Object newValue) compareAndSet
(Object expectedValue, Object newValue) Access the field using acquire mode.getAndAddAcquire
(Object value) getAndAddRelease
(Object value) getAndBitwiseAnd
(Object value) getAndBitwiseAndAcquire
(Object value) getAndBitwiseAndRelease
(Object value) getAndBitwiseOr
(Object value) getAndBitwiseOrAcquire
(Object value) getAndBitwiseOrRelease
(Object value) getAndBitwiseXor
(Object value) getAndBitwiseXorAcquire
(Object value) getAndBitwiseXorRelease
(Object value) getAndSetAcquire
(Object value) getAndSetRelease
(Object value) Access the field using opaque mode.getPlain()
Access the field using plain mode, ignoring any volatile declaration.Access the field as if it was declared volatile.Returns aMethodHandle
variable for getting the field value.Returns aMethodHandle
variable for setting the field value.default Field
Fields cannot be renamed, and so this method always throws anIllegalStateException
.Assign a value to this variable, either from another variable or from a constant.void
Set the field using opaque mode.void
Set the field using plain mode, ignoring any volatile declaration.void
setRelease
(Object value) Set the field using release mode.void
setVolatile
(Object value) Set the field as if it was declared volatile.default Field
Fields cannot have a signature defined within the body of a method, and so this method always throws anIllegalStateException
.Returns aVarHandle
variable which accesses the field.weakCompareAndSet
(Object expectedValue, Object newValue) weakCompareAndSetAcquire
(Object expectedValue, Object newValue) weakCompareAndSetPlain
(Object expectedValue, Object newValue) weakCompareAndSetRelease
(Object expectedValue, Object newValue) Methods inherited from interface org.cojen.maker.Variable
add, addAnnotation, aget, alength, and, aset, box, boxedType, cast, classType, clear, com, condy, dec, div, eq, field, ge, get, gt, ifEq, ifEq, ifEq, ifFalse, ifFalse, ifFalse, ifGe, ifGe, ifGe, ifGt, ifGt, ifGt, ifLe, ifLe, ifLe, ifLt, ifLt, ifLt, ifNe, ifNe, ifNe, ifTrue, ifTrue, ifTrue, inc, indy, instanceOf, invoke, invoke, le, lt, makerType, methodHandle, methodMaker, monitorEnter, monitorExit, mul, name, ne, neg, not, or, rem, setExact, shl, shr, sub, switch_, switch_, switch_, switch_, synchronized_, throw_, type, unbox, unboxedType, ushr, xor
-
Method Details
-
name
Fields cannot be renamed, and so this method always throws anIllegalStateException
. -
signature
Fields cannot have a signature defined within the body of a method, and so this method always throws anIllegalStateException
. -
set
Assign a value to this variable, either from another variable or from a constant. A constant value can be a primitive type (boxed or unboxed),null
, aString
, aClass
, anEnum
, aMethodType
, aMethodHandleInfo
, aConstantDesc
, or aConstable
.Note that a
MethodHandle
can be set with aMethodHandleInfo
, which is converted automatically at link time. Handling ofConstantDesc
andConstable
is also treated specially — the actual type is determined by the resolved constant. -
getPlain
Variable getPlain()Access the field using plain mode, ignoring any volatile declaration.- Returns:
- the result in a new variable, with the same type as this one
- See Also:
-
setPlain
Set the field using plain mode, ignoring any volatile declaration.- See Also:
-
getOpaque
Variable getOpaque()Access the field using opaque mode.- Returns:
- the result in a new variable, with the same type as this one
- See Also:
-
setOpaque
-
getAcquire
Variable getAcquire()Access the field using acquire mode.- Returns:
- the result in a new variable, with the same type as this one
- See Also:
-
setRelease
-
getVolatile
Variable getVolatile()Access the field as if it was declared volatile.- Returns:
- the result in a new variable, with the same type as this one
- See Also:
-
setVolatile
-
compareAndSet
-
compareAndExchange
-
compareAndExchangeAcquire
-
compareAndExchangeRelease
-
weakCompareAndSetPlain
-
weakCompareAndSet
-
weakCompareAndSetAcquire
-
weakCompareAndSetRelease
-
getAndSet
-
getAndSetAcquire
-
getAndSetRelease
-
getAndAdd
-
getAndAddAcquire
-
getAndAddRelease
-
getAndBitwiseOr
-
getAndBitwiseOrAcquire
-
getAndBitwiseOrRelease
-
getAndBitwiseAnd
-
getAndBitwiseAndAcquire
-
getAndBitwiseAndRelease
-
getAndBitwiseXor
-
getAndBitwiseXorAcquire
-
getAndBitwiseXorRelease
-
varHandle
Variable varHandle()Returns aVarHandle
variable which accesses the field. If this is an ordinary field, the variable is actually a constant, and so it can be supplied as an argument to abootstrap
method or be used by another method in the same class. For non-static fields, the firstVarHandle
coordinate is the object instance which owns the field. Static fields have no coordinates. -
methodHandleSet
Variable methodHandleSet()Returns aMethodHandle
variable for setting the field value. If this is an ordinary field, the variable is actually a constant, and so it can be supplied as an argument to abootstrap
method or be used by another method in the same class. For non-static fields, theMethodHandle
accepts two arguments: the object instance which owns the field, and the value to set. For static fields, the only argument is the value to set. -
methodHandleGet
Variable methodHandleGet()Returns aMethodHandle
variable for getting the field value. If this is an ordinary field, the variable is actually a constant, and so it can be supplied as an argument to abootstrap
method or be used by another method in the same class. For non-static fields, theMethodHandle
accepts one argument: the object instance which owns the field. For static fields, there are no arguments.
-