| Modifier and Type | Field and Description |
|---|---|
| protected final int | classId
the symbol of the class associated with this variable |
| public static final VariableAccessor | DUMMY_ACCESSOR
a dummy accessor that will always return null |
| protected final int | index
the index allocated for it in the variable table |
| protected final String | name
the name of the variable |
| protected final RubyClass | realClass
the "real" class associated with this variable |
| pack-priv static final VarHandle | |
| pack-priv static final VarHandle |
| Access | Constructor and Description |
|---|---|
| public | VariableAccessor(RubyClass
the "real" class realClass, String the variable's name name, int the variable's index index, int the class's symbol classId)Construct a new VariableAccessor for the given "real" class, name, variable index, and class symbol. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public int | Returns: this variable's class's idGet the symbol of the class associated with this variable. |
| public int | |
| public String | |
| public IRubyObject | Returns: the variable's valuethe object from which to retrieve this variable object, ThreadContext context)Retrieve the variable's value from the given object. |
| public Object | |
| public static Object | Returns: the variable's valuethe object from which to retrieve the variable object, int the index of the variable index)Retrieve the variable's value from the given object. |
| public void | |
| public String | Returns: a string representation of this VariableAccessorOverrides java. Produce a string representation of this VariableAccessor. |
| public boolean |
| classId | back to summary |
|---|---|
| protected final int classId the symbol of the class associated with this variable | |
| DUMMY_ACCESSOR | back to summary |
|---|---|
| public static final VariableAccessor DUMMY_ACCESSOR a dummy accessor that will always return null | |
| index | back to summary |
|---|---|
| protected final int index the index allocated for it in the variable table | |
| name | back to summary |
|---|---|
| protected final String name the name of the variable | |
| realClass | back to summary |
|---|---|
| protected final RubyClass realClass the "real" class associated with this variable | |
| STAMP_HANDLE | back to summary |
|---|---|
| pack-priv static final VarHandle STAMP_HANDLE | |
| VAR_TABLE_HANDLE | back to summary |
|---|---|
| pack-priv static final VarHandle VAR_TABLE_HANDLE | |
| VariableAccessor | back to summary |
|---|---|
| public VariableAccessor(RubyClass realClass, String name, int index, int classId) Construct a new VariableAccessor for the given "real" class, name, variable index, and class symbol. | |
| get | back to summary |
|---|---|
| public Object get(Object object) Retrieve the variable's value from the given object. | |
| getClassId | back to summary |
|---|---|
| public int getClassId() Get the symbol of the class associated with this variable.
| |
| getIndex | back to summary |
|---|---|
| public int getIndex() Get the index allocated for this variable.
| |
| getName | back to summary |
|---|---|
| public String getName() Get the name of this variable.
| |
| getOrNil | back to summary |
|---|---|
| public IRubyObject getOrNil(Object object, ThreadContext context) Retrieve the variable's value from the given object.
| |
| getOrUndefined | back to summary |
|---|---|
| public Object getOrUndefined(Object object) Retrieve object or IR %undefined | |
| getVariable | back to summary |
|---|---|
| public static Object getVariable(RubyBasicObject object, int index) Retrieve the variable's value from the given object. This version is static, allowing it to be more direct, and accepts nnly with RubyBasicObject and subclasses along with the direct index of the variable.
| |
| set | back to summary |
|---|---|
| public void set(Object object, Object value) Set the value for this variable in the given object. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Produce a string representation of this VariableAccessor. | |
| verify | back to summary |
|---|---|
| public boolean verify(Object object) Verify if this is the correct accessor for the given object.
| |