public class SynchronizedVariableAccessor extends VariableAccessor
classId, DUMMY_ACCESSOR, index, name, realClass| Constructor and Description |
|---|
SynchronizedVariableAccessor(RubyClass realClass,
java.lang.String name,
int index,
int classId)
Construct a new SynchronizedVariableAccessor for the given "real" class,
variable name, variable index, and class ID.
|
| Modifier and Type | Method and Description |
|---|---|
private static java.lang.Object[] |
createTable(RubyBasicObject self,
RubyClass realClass)
Create a new table for the given object sufficient in size to accommodate
all known variables.
|
private static java.lang.Object[] |
ensureTable(RubyBasicObject self,
RubyClass realClass,
int index)
Ensure the variable table is ready to receive the given variable index.
|
private static java.lang.Object[] |
growTable(RubyBasicObject self,
RubyClass realClass,
java.lang.Object[] currentTable)
Grow an existing table to accommodate all known variables.
|
void |
set(java.lang.Object object,
java.lang.Object value)
Set this variable into the given object using synchronization to ensure
safe updating of the variable table.
|
static void |
setVariable(RubyBasicObject self,
RubyClass realClass,
int index,
java.lang.Object value)
Set the given variable index into the specified object.
|
static void |
setVariableChecked(RubyBasicObject self,
RubyClass realClass,
int index,
java.lang.Object value)
Set the given variable index into the specified object.
|
get, getClassId, getIndex, getName, getVariablepublic SynchronizedVariableAccessor(RubyClass realClass, java.lang.String name, int index, int classId)
realClass - the "real" classname - the variable's nameindex - the variable's indexclassId - the class's IDpublic void set(java.lang.Object object,
java.lang.Object value)
set in class VariableAccessorobject - the object into which to set this variablevalue - the variable's valuepublic static void setVariableChecked(RubyBasicObject self, RubyClass realClass, int index, java.lang.Object value)
self - the object into which to set the variablerealClass - the "real" class for the objectindex - the index of the variablevalue - the variable's valuepublic static void setVariable(RubyBasicObject self, RubyClass realClass, int index, java.lang.Object value)
self - the object into which to set the variablerealClass - the "real" class for the objectindex - the index of the variablevalue - the variable's valueprivate static java.lang.Object[] ensureTable(RubyBasicObject self, RubyClass realClass, int index)
self - the object that holds the variable tablerealClass - the "real" class of the objectindex - the variable's indexprivate static java.lang.Object[] createTable(RubyBasicObject self, RubyClass realClass)
self - the object to hold the tablerealClass - the "real" class for the objectprivate static java.lang.Object[] growTable(RubyBasicObject self, RubyClass realClass, java.lang.Object[] currentTable)
self - the object to hold the tablerealClass - the "real" class for the objectcurrentTable - the current table