|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyModule
org.jruby.RubyClass
org.jruby.IncludedModuleWrapper
public final class IncludedModuleWrapper
This class is used to provide an intermediate superclass for modules and classes that include other modules. It inserts itself as the immediate superClass of the includer, but defers all module methods to the actual superclass. Multiple of these intermediate superclasses can be added for multiple included modules. This allows the normal superclass-based searches (searchMethod, getConstant, etc) to traverse the superclass ancestors as normal while the included modules do not actually show up in direct inheritance traversal.
RubyModule
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class org.jruby.RubyModule |
---|
RubyModule.ConstantTableEntry, RubyModule.KindOf, RubyModule.MethodClumper, RubyModule.ModuleKernelMethods |
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry |
Field Summary |
---|
Fields inherited from class org.jruby.RubyClass |
---|
CLASS_ALLOCATOR, DEFAULT_OBJECT_MARSHAL, marshal |
Fields inherited from class org.jruby.RubyObject |
---|
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, metaClassName, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
IncludedModuleWrapper(Ruby runtime,
RubyClass superClass,
RubyModule delegate)
|
Method Summary | |
---|---|
void |
addMethod(java.lang.String name,
DynamicMethod method)
|
protected boolean |
constantTableContains(java.lang.String name)
|
protected boolean |
constantTableFastContains(java.lang.String internedName)
|
protected IRubyObject |
constantTableFastFetch(java.lang.String internedName)
|
protected IRubyObject |
constantTableFastStore(java.lang.String internedName,
IRubyObject value)
|
protected IRubyObject |
constantTableFetch(java.lang.String name)
|
protected java.util.Map |
constantTableGetMap()
Deprecated. |
protected java.util.Map |
constantTableGetMap(java.util.Map map)
Deprecated. |
protected int |
constantTableGetSize()
|
protected RubyModule.ConstantTableEntry[] |
constantTableGetTable()
|
protected IRubyObject |
constantTableRemove(java.lang.String name)
|
protected IRubyObject |
constantTableStore(java.lang.String name,
IRubyObject value)
|
protected void |
constantTableSync(java.util.List<Variable<IRubyObject>> vars)
|
java.util.Map<java.lang.String,DynamicMethod> |
getMethods()
|
java.lang.String |
getName()
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes. |
RubyModule |
getNonIncludedClass()
|
RubyClass |
getRealClass()
|
IRubyObject |
id()
We don't want to reveal ourselves to Ruby code, so delegate this operation. |
boolean |
isClass()
Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way. |
boolean |
isImmediate()
Is object immediate (def: Fixnum, Symbol, true, false, nil?). |
boolean |
isIncluded()
Is this module one that in an included one (e.g. |
boolean |
isModule()
Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way. |
protected boolean |
isSame(RubyModule module)
|
IncludedModuleWrapper |
newIncludeClass(RubyClass superClass)
Overridden newIncludeClass implementation to allow attaching future includes to the correct module (i.e. |
void |
setMetaClass(RubyClass newRubyClass)
Makes it possible to change the metaclass of an object. |
void |
setMethods(java.util.Map newMethods)
|
protected boolean |
variableTableContains(java.lang.String name)
Checks if the variable table contains a variable of the specified name. |
protected boolean |
variableTableFastContains(java.lang.String internedName)
Checks if the variable table contains the the variable of the specified name, where the precondition is that the name must be an interned Java String. |
protected IRubyObject |
variableTableFastFetch(java.lang.String internedName)
Fetch an object from the variable table based on the name, where the name must be an interned Java String. |
protected IRubyObject |
variableTableFastStore(java.lang.String internedName,
IRubyObject value)
Will store the value under the specified name, where the name needs to be an interned Java String. |
protected IRubyObject |
variableTableFetch(java.lang.String name)
Fetch an object from the variable table based on the name. |
protected java.util.Map |
variableTableGetMap()
Deprecated. |
protected java.util.Map |
variableTableGetMap(java.util.Map map)
Deprecated. |
protected int |
variableTableGetSize()
Get the size of the variable table. |
protected RubyObject.VariableTableEntry[] |
variableTableGetTable()
Get the actual table used to save variable entries. |
protected IRubyObject |
variableTableReadLocked(RubyObject.VariableTableEntry entry)
Reads the value of the specified entry, locked on the current object. |
protected IRubyObject |
variableTableRemove(java.lang.String name)
Removes the entry with the specified name from the variable table, and returning the removed value. |
protected IRubyObject |
variableTableStore(java.lang.String name,
IRubyObject value)
Store a value in the variable store under the specific name. |
protected void |
variableTableSync(java.util.List<Variable<IRubyObject>> vars)
Synchronize the variable table with the argument. |
Methods inherited from class org.jruby.RubyClass |
---|
addSubclass, allocate, checkInheritable, createBootstrapClass, createClassClass, getAllocator, getClassRuntime, getMarshal, getNativeTypeIndex, inherit, inherited, initialize_copy, initialize, invoke, invoke, invoke, invokeInherited, isSingleton, makeMetaClass, marshal, marshalTo, newClass, newClass, newInstance, setAllocator, setMarshal, subclasses, subclasses, superclass, unmarshal, unmarshalFrom |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IncludedModuleWrapper(Ruby runtime, RubyClass superClass, RubyModule delegate)
Method Detail |
---|
public IncludedModuleWrapper newIncludeClass(RubyClass superClass)
newIncludeClass
in class RubyModule
RubyModule.newIncludeClass(RubyClass)
public boolean isModule()
RubyObject
isModule
in interface IRubyObject
isModule
in class RubyClass
(someObject instanceof RubyModule)
instead.public boolean isClass()
RubyObject
isClass
in interface IRubyObject
isClass
in class RubyClass
(someObject instanceof RubyClass/MetaClass)
instead.public boolean isIncluded()
RubyModule
isIncluded
in class RubyModule
public boolean isImmediate()
RubyObject
isImmediate
in interface IRubyObject
isImmediate
in class RubyObject
public void setMetaClass(RubyClass newRubyClass)
RubyObject
setMetaClass
in class RubyObject
public java.util.Map<java.lang.String,DynamicMethod> getMethods()
getMethods
in class RubyModule
public void addMethod(java.lang.String name, DynamicMethod method)
addMethod
in class RubyModule
public void setMethods(java.util.Map newMethods)
public java.lang.String getName()
RubyModule
getName
in class RubyModule
public RubyModule getNonIncludedClass()
getNonIncludedClass
in class RubyModule
public RubyClass getRealClass()
getRealClass
in class RubyClass
protected boolean isSame(RubyModule module)
isSame
in class RubyModule
public IRubyObject id()
id
in interface IRubyObject
id
in class RubyObject
protected boolean variableTableContains(java.lang.String name)
RubyObject
variableTableContains
in class RubyObject
protected boolean variableTableFastContains(java.lang.String internedName)
RubyObject
variableTableFastContains
in class RubyObject
protected IRubyObject variableTableFetch(java.lang.String name)
RubyObject
variableTableFetch
in class RubyObject
protected IRubyObject variableTableFastFetch(java.lang.String internedName)
RubyObject
variableTableFastFetch
in class RubyObject
protected IRubyObject variableTableStore(java.lang.String name, IRubyObject value)
RubyObject
variableTableStore
in class RubyModule
protected IRubyObject variableTableFastStore(java.lang.String internedName, IRubyObject value)
RubyObject
variableTableFastStore
in class RubyModule
protected IRubyObject variableTableRemove(java.lang.String name)
RubyObject
variableTableRemove
in class RubyModule
protected RubyObject.VariableTableEntry[] variableTableGetTable()
RubyObject
variableTableGetTable
in class RubyObject
protected int variableTableGetSize()
RubyObject
variableTableGetSize
in class RubyObject
protected void variableTableSync(java.util.List<Variable<IRubyObject>> vars)
RubyObject
variableTableSync
in class RubyModule
protected IRubyObject variableTableReadLocked(RubyObject.VariableTableEntry entry)
RubyObject
variableTableReadLocked
in class RubyModule
@Deprecated protected java.util.Map variableTableGetMap()
variableTableGetMap
in class RubyObject
@Deprecated protected java.util.Map variableTableGetMap(java.util.Map map)
variableTableGetMap
in class RubyObject
protected boolean constantTableContains(java.lang.String name)
constantTableContains
in class RubyModule
protected boolean constantTableFastContains(java.lang.String internedName)
constantTableFastContains
in class RubyModule
protected IRubyObject constantTableFetch(java.lang.String name)
constantTableFetch
in class RubyModule
protected IRubyObject constantTableFastFetch(java.lang.String internedName)
constantTableFastFetch
in class RubyModule
protected IRubyObject constantTableStore(java.lang.String name, IRubyObject value)
constantTableStore
in class RubyModule
protected IRubyObject constantTableFastStore(java.lang.String internedName, IRubyObject value)
constantTableFastStore
in class RubyModule
protected IRubyObject constantTableRemove(java.lang.String name)
constantTableRemove
in class RubyModule
protected RubyModule.ConstantTableEntry[] constantTableGetTable()
constantTableGetTable
in class RubyModule
protected int constantTableGetSize()
constantTableGetSize
in class RubyModule
protected void constantTableSync(java.util.List<Variable<IRubyObject>> vars)
constantTableSync
in class RubyModule
@Deprecated protected java.util.Map constantTableGetMap()
constantTableGetMap
in class RubyModule
@Deprecated protected java.util.Map constantTableGetMap(java.util.Map map)
constantTableGetMap
in class RubyModule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |