public class FieldVariableAccessor extends VariableAccessor
classId, DUMMY_ACCESSOR, index, name, realClass
Constructor and Description |
---|
FieldVariableAccessor(RubyClass realClass,
java.lang.String name,
int index,
int classId,
java.lang.invoke.MethodHandle getter,
java.lang.invoke.MethodHandle setter)
Construct a new FieldVariableAccessor for the given "real" class,
variable name, variable index, class ID, and field offset
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.Object object)
Retrieve the variable's value from the given object.
|
java.lang.invoke.MethodHandle |
getGetter() |
java.lang.invoke.MethodHandle |
getSetter() |
void |
set(java.lang.Object object,
java.lang.Object value)
Set this variable into the given object using Unsafe to ensure
safe updating of the variable table.
|
getClassId, getIndex, getName, getVariable, toString, verify
public FieldVariableAccessor(RubyClass realClass, java.lang.String name, int index, int classId, java.lang.invoke.MethodHandle getter, java.lang.invoke.MethodHandle setter)
realClass
- the "real" classname
- the variable's nameindex
- the variable's indexclassId
- the class's IDgetter
- the getter handle for the fieldsetter
- the setter handle for the fieldpublic java.lang.invoke.MethodHandle getGetter()
public java.lang.invoke.MethodHandle getSetter()
public java.lang.Object get(java.lang.Object object)
get
in class VariableAccessor
object
- the object from which to retrieve this variablepublic void set(java.lang.Object object, java.lang.Object value)
set
in class VariableAccessor
object
- the object into which to set this variablevalue
- the variable's valueCopyright © 2001-2020 JRuby. All Rights Reserved.