org.jruby
Class RubyModule

java.lang.Object
  extended by org.jruby.RubyObject
      extended by org.jruby.RubyModule
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
Direct Known Subclasses:
RubyClass

public class RubyModule
extends RubyObject

Author:
jpetersen
See Also:
Serialized Form

Nested Class Summary
protected static class RubyModule.ConstantTableEntry
           
static class RubyModule.KindOf
           
static class RubyModule.MethodClumper
           
static class RubyModule.ModuleKernelMethods
           
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry
 
Field Summary
protected  java.lang.String classId
           
protected static int CONSTANT_TABLE_DEFAULT_CAPACITY
           
protected static float CONSTANT_TABLE_LOAD_FACTOR
           
protected static int CONSTANT_TABLE_MAXIMUM_CAPACITY
           
protected  RubyModule.ConstantTableEntry[] constantTable
           
protected  int constantTableSize
           
protected  int constantTableThreshold
           
 Dispatcher dispatcher
           
protected static java.lang.String ERR_FROZEN_CONST_TYPE
           
protected static java.lang.String ERR_FROZEN_CVAR_TYPE
           
protected static java.lang.String ERR_INSECURE_SET_CLASS_VAR
           
protected static java.lang.String ERR_INSECURE_SET_CONSTANT
           
 int id
           
 int index
           
 RubyModule.KindOf kindOf
           
 RubyModule parent
           
protected  RubyClass superClass
           
protected  java.util.concurrent.locks.ReentrantLock variableWriteLock
           
 
Fields inherited from class org.jruby.RubyObject
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, 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
protected RubyModule(Ruby runtime)
          standard path for Module construction
protected RubyModule(Ruby runtime, RubyClass metaClass)
          used by MODULE_ALLOCATOR and RubyClass constructors
protected RubyModule(Ruby runtime, RubyClass metaClass, boolean objectSpace)
          separate path for MetaClass construction
 
Method Summary
 void addClassProvider(ClassProvider provider)
           
 void addMethod(java.lang.String name, DynamicMethod method)
           
 void addModuleFunction(java.lang.String name, DynamicMethod method)
           
 RubyModule alias_method(ThreadContext context, IRubyObject newId, IRubyObject oldId)
           
 RubyArray ancestors()
          Deprecated. 
 RubyArray ancestors(ThreadContext context)
          rb_mod_ancestors
 RubyModule append_features(IRubyObject module)
          rb_mod_append_features
 IRubyObject attr_accessor(IRubyObject[] args)
          Deprecated.  
 IRubyObject attr_accessor(ThreadContext context, IRubyObject[] args)
          rb_mod_attr_accessor
 IRubyObject attr_reader(IRubyObject[] args)
          Deprecated.  
 IRubyObject attr_reader(ThreadContext context, IRubyObject[] args)
          rb_mod_attr_reader
 IRubyObject attr_writer(ThreadContext context, IRubyObject[] args)
          rb_mod_attr_writer
 IRubyObject attr(ThreadContext context, IRubyObject[] args)
          rb_mod_attr
 IRubyObject class_variable_defined_p(ThreadContext context, IRubyObject var)
           
 IRubyObject class_variable_get(IRubyObject var)
          rb_mod_cvar_get
 IRubyObject class_variable_set(IRubyObject var, IRubyObject value)
          rb_mod_cvar_set
 RubyArray class_variables(ThreadContext context)
          rb_mod_class_variables
protected  IRubyObject cloneMethods(RubyModule clone)
           
 RubyBoolean const_defined_p(ThreadContext context, IRubyObject symbol)
          rb_mod_const_defined
 IRubyObject const_get(IRubyObject symbol)
          rb_mod_const_get
 IRubyObject const_missing(ThreadContext context, IRubyObject name, Block block)
          Base implementation of Module#const_missing, throws NameError for specific missing constant.
 IRubyObject const_set(IRubyObject symbol, IRubyObject value)
          rb_mod_const_set
 RubyArray constants(ThreadContext context)
          rb_mod_constants
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()
          Method to help ease transition to new variables implementation.
protected  java.util.Map constantTableGetMap(java.util.Map map)
          Method to help ease transition to new variables implementation.
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)
           
static RubyClass createModuleClass(Ruby runtime, RubyClass moduleClass)
           
 IRubyObject define_method(ThreadContext context, IRubyObject[] args, Block block)
          Deprecated. 
 IRubyObject define_method(ThreadContext context, IRubyObject arg0, Block block)
           
 IRubyObject define_method(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
           
 void defineAlias(java.lang.String name, java.lang.String oldName)
          rb_alias
 void defineAliases(java.util.List<java.lang.String> aliases, java.lang.String oldName)
           
 boolean defineAnnotatedConstant(java.lang.reflect.Field field)
           
 void defineAnnotatedConstants(java.lang.Class clazz)
           
 void defineAnnotatedMethod(java.lang.Class clazz, java.lang.String name)
           
 boolean defineAnnotatedMethod(JavaMethodDescriptor desc, MethodFactory methodFactory)
           
 boolean defineAnnotatedMethod(java.lang.reflect.Method method, MethodFactory methodFactory)
           
 boolean defineAnnotatedMethod(java.lang.String name, java.util.List<JavaMethodDescriptor> methods, MethodFactory methodFactory)
           
 void defineAnnotatedMethods(java.lang.Class clazz)
           
 void defineAnnotatedMethodsIndividually(java.lang.Class clazz)
           
 RubyClass defineClassUnder(java.lang.String name, RubyClass superClass, ObjectAllocator allocator)
          rb_define_class_under this method should be used only as an API to define/open nested classes
 void defineConstant(java.lang.String name, IRubyObject value)
          rb_define_const
 void defineFastMethod(java.lang.String name, Callback method)
           
 void defineFastMethod(java.lang.String name, Callback method, Visibility visibility)
           
 void defineFastModuleFunction(java.lang.String name, Callback method)
          rb_define_module_function
 void defineFastPrivateMethod(java.lang.String name, Callback method)
           
 void defineFastProtectedMethod(java.lang.String name, Callback method)
           
 void defineFastPublicModuleFunction(java.lang.String name, Callback method)
          rb_define_module_function
 void defineMethod(java.lang.String name, Callback method)
           
 void defineModuleFunction(java.lang.String name, Callback method)
          rb_define_module_function
 RubyModule defineModuleUnder(java.lang.String name)
          rb_define_module_under this method should be used only as an API to define/open nested module
 RubyClass defineOrGetClassUnder(java.lang.String name, RubyClass superClazz)
          this method should be used only by interpreter or compiler
 RubyModule defineOrGetModuleUnder(java.lang.String name)
          this method should be used only by interpreter or compiler
 void definePrivateMethod(java.lang.String name, Callback method)
           
 void definePublicModuleFunction(java.lang.String name, Callback method)
          rb_define_module_function
 IRubyObject deleteClassVariable(java.lang.String name)
           
 IRubyObject deleteConstant(java.lang.String name)
           
protected  void ensureClassVariablesSettable()
           
protected  void ensureConstantsSettable()
           
 IRubyObject executeUnder(ThreadContext context, Callback method, IRubyObject[] args, Block block)
          Deprecated. 
 void exportMethod(java.lang.String name, Visibility visibility)
          rb_export_method
 IRubyObject extend_object(IRubyObject obj)
          rb_mod_extend_object
 IRubyObject extended(ThreadContext context, IRubyObject other, Block block)
           
 IRubyObject fastFetchClassVariable(java.lang.String internedName)
           
 IRubyObject fastFetchConstant(java.lang.String internedName)
           
 RubyClass fastGetClass(java.lang.String internedName)
           
 IRubyObject fastGetClassVar(java.lang.String internedName)
           
 IRubyObject fastGetConstant(java.lang.String internedName)
           
 IRubyObject fastGetConstantAt(java.lang.String internedName)
           
 IRubyObject fastGetConstantFrom(java.lang.String internedName)
           
 boolean fastHasClassVariable(java.lang.String internedName)
           
 boolean fastHasConstant(java.lang.String internedName)
           
 boolean fastIsClassVarDefined(java.lang.String internedName)
           
 boolean fastIsConstantDefined(java.lang.String internedName)
           
 IRubyObject fastSetClassVar(java.lang.String internedName, IRubyObject value)
           
 IRubyObject fastSetConstant(java.lang.String internedName, IRubyObject value)
           
 IRubyObject fastStoreClassVariable(java.lang.String internedName, IRubyObject value)
           
 IRubyObject fastStoreConstant(java.lang.String internedName, IRubyObject value)
           
 IRubyObject fetchClassVariable(java.lang.String name)
           
 IRubyObject fetchConstant(java.lang.String name)
           
 RubyModule findImplementer(RubyModule clazz)
          Search through this module and supermodules for method definitions.
 IRubyObject freeze(ThreadContext context)
          rb_mod_freeze
 java.util.List<IRubyObject> getAncestorList()
           
 java.lang.String getBaseName()
           
 RubyClass getClass(java.lang.String name)
          Finds a class that is within the current module (or class).
 IRubyObject getClassVar(java.lang.String name)
          Retrieve the specified class variable, searching through this module, included modules, and supermodules.
 java.util.List<Variable<IRubyObject>> getClassVariableList()
           
 java.util.List<java.lang.String> getClassVariableNameList()
           
 IRubyObject getConstant(java.lang.String name)
          Retrieve the named constant, invoking 'const_missing' should that be appropriate.
 IRubyObject getConstantAt(java.lang.String name)
           
 IRubyObject getConstantFrom(java.lang.String name)
           
 Dispatcher getDispatcher()
           
 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.
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 RubyModule getNonIncludedClass()
           
 RubyModule getParent()
           
 java.util.List<Variable<IRubyObject>> getStoredConstantList()
           
 java.util.List<java.lang.String> getStoredConstantNameList()
           
 RubyClass getSuperClass()
          Getter for property superClass.
 int getVariableCount()
          Returns the amount of instance variables, class variables, constants and internal variables this object has.
 java.util.List<Variable<IRubyObject>> getVariableList()
          Gets a list of all variables in this object.
 java.util.Map getVariableMap()
          Deprecated. 
 java.util.List<java.lang.String> getVariableNameList()
          Gets a name list of all variables in this object.
 boolean hasClassVariable(java.lang.String name)
           
 boolean hasConstant(java.lang.String name)
           
 RubyFixnum hash()
          rb_obj_id Will return the hash code of this object.
 int hashCode()
          Override the Object#hashCode method to make sure that the Ruby hash is actually used as the hashcode for Ruby objects.
 boolean hasInternalModuleVariable(java.lang.String name)
          Behaves similarly to getClassVar(String).
 boolean hasModuleInHierarchy(RubyModule type)
           
 boolean hasVariables()
          Returns true if object has any variables, defined as: instance variables class variables constants internal variables, such as those used when marshaling Ranges and Exceptions
 IRubyObject include_p(ThreadContext context, IRubyObject arg)
           
 RubyModule include(IRubyObject[] modules)
          rb_mod_include
 RubyArray included_modules(ThreadContext context)
          rb_mod_included_modules
 IRubyObject included(ThreadContext context, IRubyObject other)
           
 void includeModule(IRubyObject arg)
          Include a new module in this module or class.
 IRubyObject initialize_copy(IRubyObject original)
          rb_mod_init_copy
 IRubyObject initialize(Block block)
          rb_mod_initialize
 IRubyObject instance_method(IRubyObject symbol)
           
 RubyArray instance_methods(IRubyObject[] args)
           
 boolean isClass()
          Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.
 boolean isClassVarDefined(java.lang.String name)
          Is class var defined? Ruby C equivalent = "rb_cvar_defined"
 boolean isConstantDefined(java.lang.String name)
          rb_const_defined_at
 boolean isIncluded()
          Is this module one that in an included one (e.g.
 boolean isInstance(IRubyObject object)
           
 boolean isKindOfModule(RubyModule type)
           
 boolean isMethodBound(java.lang.String name, boolean checkVisibility)
          MRI: rb_method_boundp
 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)
           
 boolean isSingleton()
           
static void marshalTo(RubyModule module, MarshalStream output)
           
 IRubyObject method_added(ThreadContext context, IRubyObject nothing)
           
 RubyBoolean method_defined_p(ThreadContext context, IRubyObject symbol)
           
 IRubyObject method_removed(ThreadContext context, IRubyObject nothing)
           
 IRubyObject method_undefined(ThreadContext context, IRubyObject nothing)
           
 IRubyObject module_eval(ThreadContext context, Block block)
           
 IRubyObject module_eval(ThreadContext context, IRubyObject[] args, Block block)
          Deprecated. 
 IRubyObject module_eval(ThreadContext context, IRubyObject arg0, Block block)
           
 IRubyObject module_eval(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
           
 IRubyObject module_eval(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
           
 RubyModule module_function(ThreadContext context, IRubyObject[] args)
          rb_mod_modfunc
 RubyString name()
           
 boolean needsImplementer()
           
static RubyArray nesting(ThreadContext context, IRubyObject recv, Block block)
          Return an array of nested modules or classes.
 IncludedModuleWrapper newIncludeClass(RubyClass superClazz)
          Create a wrapper to use for including the specified module into this one.
 IRubyObject newMethod(IRubyObject receiver, java.lang.String name, boolean bound)
           
static RubyModule newModule(Ruby runtime)
          rb_module_new
static RubyModule newModule(Ruby runtime, java.lang.String name, RubyModule parent, boolean setParent)
          rb_module_new/rb_define_module_id/rb_name_class/rb_set_class_path
 IRubyObject op_cmp(IRubyObject obj)
          rb_mod_cmp
 RubyBoolean op_eqq(ThreadContext context, IRubyObject obj)
          rb_mod_eqq
 IRubyObject op_equal(ThreadContext context, IRubyObject other)
          rb_obj_equal Will by default use identity equality to compare objects.
 IRubyObject op_ge(IRubyObject obj)
          rb_mod_ge
 IRubyObject op_gt(IRubyObject obj)
          rb_mod_gt
 IRubyObject op_le(IRubyObject obj)
          rb_mod_le
 IRubyObject op_lt(IRubyObject obj)
          rb_mod_lt
 RubyModule private_class_method(IRubyObject[] args)
           
 RubyArray private_instance_methods(IRubyObject[] args)
          rb_class_private_instance_methods
 IRubyObject private_method_defined(ThreadContext context, IRubyObject symbol)
           
 RubyArray protected_instance_methods(IRubyObject[] args)
          rb_class_protected_instance_methods
 IRubyObject protected_method_defined(ThreadContext context, IRubyObject symbol)
           
 RubyModule public_class_method(IRubyObject[] args)
           
 RubyArray public_instance_methods(IRubyObject[] args)
           
 IRubyObject public_method_defined(ThreadContext context, IRubyObject symbol)
           
 RubyModule rbPrivate(ThreadContext context, IRubyObject[] args)
          rb_mod_private
 RubyModule rbProtected(ThreadContext context, IRubyObject[] args)
          rb_mod_protected
 RubyModule rbPublic(ThreadContext context, IRubyObject[] args)
          rb_mod_public
 IRubyObject remove_class_variable(ThreadContext context, IRubyObject name)
          rb_mod_remove_cvar
 IRubyObject remove_const(ThreadContext context, IRubyObject name)
           
 RubyModule remove_method(ThreadContext context, IRubyObject[] args)
           
 void removeClassProvider(ClassProvider provider)
           
 IRubyObject removeCvar(IRubyObject name)
          rb_mod_remove_cvar FIXME: any good reason to have two identical methods? (same as remove_class_variable)
 void removeMethod(ThreadContext context, java.lang.String name)
           
 DynamicMethod retrieveMethod(java.lang.String name)
          Search through this module and supermodules for method definitions.
 IRubyObject searchInternalModuleVariable(java.lang.String name)
          Behaves similarly to getClassVar(String).
 DynamicMethod searchMethod(java.lang.String name)
          Search through this module and supermodules for method definitions.
 void setBaseName(java.lang.String name)
           
 IRubyObject setClassVar(java.lang.String name, IRubyObject value)
          Set the named class variable to the given value, provided taint and freeze allow setting it.
 IRubyObject setConstant(java.lang.String name, IRubyObject value)
          Set the named constant on this module.
 void setInternalModuleVariable(java.lang.String name, IRubyObject value)
          Behaves similarly to setClassVar(String, IRubyObject).
 void setMethodVisibility(IRubyObject[] methods, Visibility visibility)
          set_method_visibility
 void setParent(RubyModule parent)
           
protected  void setSuperClass(RubyClass superClass)
           
 IRubyObject storeClassVariable(java.lang.String name, IRubyObject value)
           
 IRubyObject storeConstant(java.lang.String name, IRubyObject value)
           
 void syncVariables(java.util.List<Variable<IRubyObject>> variables)
          Sync one variable table with another - this is used to make rbClone work correctly.
 IRubyObject to_s()
          rb_mod_to_s
 RubyModule undef_method(ThreadContext context, IRubyObject[] args)
           
 void undef(ThreadContext context, java.lang.String name)
          rb_undef
 void undefineMethod(java.lang.String name)
           
static RubyModule unmarshalFrom(UnmarshalStream input)
           
protected  java.lang.String validateClassVariable(java.lang.String name)
           
protected  java.lang.String validateConstant(java.lang.String name)
           
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 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.RubyObject
addFinalizer, anyToString, as, asJavaString, asString, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkFrozen, checkStringType, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, convertToType, copySpecialInstanceVariables, createObjectClass, dataGetStruct, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, frozen_p, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariableList, getInternalVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, hasInstanceVariable, hasInternalVariable, id_deprecated, id, infectBy, initialize, inspect, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isFalse, isFrozen, isImmediate, isNil, isRubyVariable, isTaint, isTrue, kind_of_p, makeMetaClass, method, methods, nil_p, op_match, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, send, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, singleton_methods, specificEval, specificEval, specificEval, specificEval, specificEval, taint, tainted_p, testFrozen, to_a, to_java, toString, type_deprecated, type, untaint, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFetch, variableTableGetMap, variableTableGetMap, variableTableGetSize, variableTableGetTable, variableTableRehash
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

superClass

protected RubyClass superClass

index

public int index

dispatcher

public Dispatcher dispatcher

kindOf

public RubyModule.KindOf kindOf

id

public final int id

parent

public RubyModule parent

classId

protected java.lang.String classId

variableWriteLock

protected final java.util.concurrent.locks.ReentrantLock variableWriteLock

constantTable

protected transient volatile RubyModule.ConstantTableEntry[] constantTable

constantTableSize

protected transient int constantTableSize

constantTableThreshold

protected transient int constantTableThreshold

ERR_INSECURE_SET_CLASS_VAR

protected static final java.lang.String ERR_INSECURE_SET_CLASS_VAR
See Also:
Constant Field Values

ERR_FROZEN_CVAR_TYPE

protected static final java.lang.String ERR_FROZEN_CVAR_TYPE
See Also:
Constant Field Values

ERR_INSECURE_SET_CONSTANT

protected static final java.lang.String ERR_INSECURE_SET_CONSTANT
See Also:
Constant Field Values

ERR_FROZEN_CONST_TYPE

protected static final java.lang.String ERR_FROZEN_CONST_TYPE
See Also:
Constant Field Values

CONSTANT_TABLE_DEFAULT_CAPACITY

protected static final int CONSTANT_TABLE_DEFAULT_CAPACITY
See Also:
Constant Field Values

CONSTANT_TABLE_MAXIMUM_CAPACITY

protected static final int CONSTANT_TABLE_MAXIMUM_CAPACITY
See Also:
Constant Field Values

CONSTANT_TABLE_LOAD_FACTOR

protected static final float CONSTANT_TABLE_LOAD_FACTOR
See Also:
Constant Field Values
Constructor Detail

RubyModule

protected RubyModule(Ruby runtime,
                     RubyClass metaClass,
                     boolean objectSpace)
separate path for MetaClass construction


RubyModule

protected RubyModule(Ruby runtime,
                     RubyClass metaClass)
used by MODULE_ALLOCATOR and RubyClass constructors


RubyModule

protected RubyModule(Ruby runtime)
standard path for Module construction

Method Detail

createModuleClass

public static RubyClass createModuleClass(Ruby runtime,
                                          RubyClass moduleClass)

getNativeTypeIndex

public int getNativeTypeIndex()
Description copied from class: RubyObject
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. Will generally return a value from org.jruby.runtime.ClassIndex

Specified by:
getNativeTypeIndex in interface CoreObjectType
Overrides:
getNativeTypeIndex in class RubyObject
Returns:
the ClassIndex of the native type this object was constructed from
See Also:
org.jruby.runtime.ClassInde

isModule

public boolean isModule()
Description copied from class: RubyObject
Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way.

Specified by:
isModule in interface IRubyObject
Overrides:
isModule in class RubyObject
Returns:
true if an object is Ruby Module instance (note that it will return false for Ruby Classes). If is_a? semantics is required, use (someObject instanceof RubyModule) instead.

isClass

public boolean isClass()
Description copied from class: RubyObject
Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.

Specified by:
isClass in interface IRubyObject
Overrides:
isClass in class RubyObject
Returns:
true if an object is Ruby Class instance (note that it will return false for Ruby singleton classes). If is_a? semantics is required, use (someObject instanceof RubyClass/MetaClass) instead.

isSingleton

public boolean isSingleton()

isInstance

public boolean isInstance(IRubyObject object)

needsImplementer

public boolean needsImplementer()

newModule

public static RubyModule newModule(Ruby runtime)
rb_module_new


newModule

public static RubyModule newModule(Ruby runtime,
                                   java.lang.String name,
                                   RubyModule parent,
                                   boolean setParent)
rb_module_new/rb_define_module_id/rb_name_class/rb_set_class_path


addClassProvider

public void addClassProvider(ClassProvider provider)

removeClassProvider

public void removeClassProvider(ClassProvider provider)

getDispatcher

public Dispatcher getDispatcher()

getSuperClass

public RubyClass getSuperClass()
Getter for property superClass.

Returns:
Value of property superClass.

setSuperClass

protected void setSuperClass(RubyClass superClass)

getParent

public RubyModule getParent()

setParent

public void setParent(RubyModule parent)

getMethods

public java.util.Map<java.lang.String,DynamicMethod> getMethods()

isIncluded

public boolean isIncluded()
Is this module one that in an included one (e.g. an IncludedModuleWrapper).


getNonIncludedClass

public RubyModule getNonIncludedClass()

getBaseName

public java.lang.String getBaseName()

setBaseName

public void setBaseName(java.lang.String name)

getName

public java.lang.String getName()
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes. Ruby C equivalent = "classname"

Returns:
The generated class name

newIncludeClass

public IncludedModuleWrapper newIncludeClass(RubyClass superClazz)
Create a wrapper to use for including the specified module into this one. Ruby C equivalent = "include_class_new"

Returns:
The module wrapper

getClass

public RubyClass getClass(java.lang.String name)
Finds a class that is within the current module (or class).

Parameters:
name - to be found in this module (or class)
Returns:
the class or null if no such class

fastGetClass

public RubyClass fastGetClass(java.lang.String internedName)

includeModule

public void includeModule(IRubyObject arg)
Include a new module in this module or class.

Parameters:
arg - The module to include

defineMethod

public void defineMethod(java.lang.String name,
                         Callback method)

defineAnnotatedMethod

public void defineAnnotatedMethod(java.lang.Class clazz,
                                  java.lang.String name)

defineAnnotatedConstants

public void defineAnnotatedConstants(java.lang.Class clazz)

defineAnnotatedConstant

public boolean defineAnnotatedConstant(java.lang.reflect.Field field)

defineAnnotatedMethods

public void defineAnnotatedMethods(java.lang.Class clazz)

defineAnnotatedMethodsIndividually

public void defineAnnotatedMethodsIndividually(java.lang.Class clazz)

defineAnnotatedMethod

public boolean defineAnnotatedMethod(java.lang.String name,
                                     java.util.List<JavaMethodDescriptor> methods,
                                     MethodFactory methodFactory)

defineAnnotatedMethod

public boolean defineAnnotatedMethod(java.lang.reflect.Method method,
                                     MethodFactory methodFactory)

defineAnnotatedMethod

public boolean defineAnnotatedMethod(JavaMethodDescriptor desc,
                                     MethodFactory methodFactory)

defineFastMethod

public void defineFastMethod(java.lang.String name,
                             Callback method)

defineFastMethod

public void defineFastMethod(java.lang.String name,
                             Callback method,
                             Visibility visibility)

definePrivateMethod

public void definePrivateMethod(java.lang.String name,
                                Callback method)

defineFastPrivateMethod

public void defineFastPrivateMethod(java.lang.String name,
                                    Callback method)

defineFastProtectedMethod

public void defineFastProtectedMethod(java.lang.String name,
                                      Callback method)

undefineMethod

public void undefineMethod(java.lang.String name)

undef

public void undef(ThreadContext context,
                  java.lang.String name)
rb_undef


include_p

public IRubyObject include_p(ThreadContext context,
                             IRubyObject arg)

addMethod

public void addMethod(java.lang.String name,
                      DynamicMethod method)

removeMethod

public void removeMethod(ThreadContext context,
                         java.lang.String name)

searchMethod

public DynamicMethod searchMethod(java.lang.String name)
Search through this module and supermodules for method definitions. Cache superclass definitions in this class.

Parameters:
name - The name of the method to search for
Returns:
The method, or UndefinedMethod if not found

retrieveMethod

public DynamicMethod retrieveMethod(java.lang.String name)
Search through this module and supermodules for method definitions. Cache superclass definitions in this class.

Parameters:
name - The name of the method to search for
Returns:
The method, or UndefinedMethod if not found

findImplementer

public RubyModule findImplementer(RubyModule clazz)
Search through this module and supermodules for method definitions. Cache superclass definitions in this class.

Parameters:
name - The name of the method to search for
Returns:
The method, or UndefinedMethod if not found

addModuleFunction

public void addModuleFunction(java.lang.String name,
                              DynamicMethod method)

defineModuleFunction

public void defineModuleFunction(java.lang.String name,
                                 Callback method)
rb_define_module_function


definePublicModuleFunction

public void definePublicModuleFunction(java.lang.String name,
                                       Callback method)
rb_define_module_function


defineFastModuleFunction

public void defineFastModuleFunction(java.lang.String name,
                                     Callback method)
rb_define_module_function


defineFastPublicModuleFunction

public void defineFastPublicModuleFunction(java.lang.String name,
                                           Callback method)
rb_define_module_function


defineAlias

public void defineAlias(java.lang.String name,
                        java.lang.String oldName)
rb_alias


defineAliases

public void defineAliases(java.util.List<java.lang.String> aliases,
                          java.lang.String oldName)

defineOrGetClassUnder

public RubyClass defineOrGetClassUnder(java.lang.String name,
                                       RubyClass superClazz)
this method should be used only by interpreter or compiler


defineOrGetModuleUnder

public RubyModule defineOrGetModuleUnder(java.lang.String name)
this method should be used only by interpreter or compiler


defineClassUnder

public RubyClass defineClassUnder(java.lang.String name,
                                  RubyClass superClass,
                                  ObjectAllocator allocator)
rb_define_class_under this method should be used only as an API to define/open nested classes


defineModuleUnder

public RubyModule defineModuleUnder(java.lang.String name)
rb_define_module_under this method should be used only as an API to define/open nested module


setMethodVisibility

public void setMethodVisibility(IRubyObject[] methods,
                                Visibility visibility)
set_method_visibility


exportMethod

public void exportMethod(java.lang.String name,
                         Visibility visibility)
rb_export_method


isMethodBound

public boolean isMethodBound(java.lang.String name,
                             boolean checkVisibility)
MRI: rb_method_boundp


newMethod

public IRubyObject newMethod(IRubyObject receiver,
                             java.lang.String name,
                             boolean bound)

define_method

public IRubyObject define_method(ThreadContext context,
                                 IRubyObject arg0,
                                 Block block)

define_method

public IRubyObject define_method(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 Block block)

define_method

@Deprecated
public IRubyObject define_method(ThreadContext context,
                                            IRubyObject[] args,
                                            Block block)
Deprecated. 


executeUnder

@Deprecated
public IRubyObject executeUnder(ThreadContext context,
                                           Callback method,
                                           IRubyObject[] args,
                                           Block block)
Deprecated. 


name

public RubyString name()

cloneMethods

protected IRubyObject cloneMethods(RubyModule clone)

initialize_copy

public IRubyObject initialize_copy(IRubyObject original)
rb_mod_init_copy

Overrides:
initialize_copy in class RubyObject

included_modules

public RubyArray included_modules(ThreadContext context)
rb_mod_included_modules


ancestors

public RubyArray ancestors(ThreadContext context)
rb_mod_ancestors


ancestors

@Deprecated
public RubyArray ancestors()
Deprecated. 


getAncestorList

public java.util.List<IRubyObject> getAncestorList()

hasModuleInHierarchy

public boolean hasModuleInHierarchy(RubyModule type)

hashCode

public int hashCode()
Description copied from class: RubyObject
Override the Object#hashCode method to make sure that the Ruby hash is actually used as the hashcode for Ruby objects. If the Ruby "hash" method doesn't return a number, the Object#hashCode implementation will be used instead.

Overrides:
hashCode in class RubyObject

hash

public RubyFixnum hash()
Description copied from class: RubyObject
rb_obj_id Will return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.

Overrides:
hash in class RubyObject

to_s

public IRubyObject to_s()
rb_mod_to_s

Overrides:
to_s in class RubyObject

op_eqq

public RubyBoolean op_eqq(ThreadContext context,
                          IRubyObject obj)
rb_mod_eqq

Specified by:
op_eqq in interface IRubyObject
Overrides:
op_eqq in class RubyObject

op_equal

public IRubyObject op_equal(ThreadContext context,
                            IRubyObject other)
Description copied from class: RubyObject
rb_obj_equal Will by default use identity equality to compare objects. This follows the Ruby semantics.

Specified by:
op_equal in interface IRubyObject
Overrides:
op_equal in class RubyObject

freeze

public IRubyObject freeze(ThreadContext context)
rb_mod_freeze

Overrides:
freeze in class RubyObject

op_le

public IRubyObject op_le(IRubyObject obj)
rb_mod_le


op_lt

public IRubyObject op_lt(IRubyObject obj)
rb_mod_lt


op_ge

public IRubyObject op_ge(IRubyObject obj)
rb_mod_ge


op_gt

public IRubyObject op_gt(IRubyObject obj)
rb_mod_gt


op_cmp

public IRubyObject op_cmp(IRubyObject obj)
rb_mod_cmp


isKindOfModule

public boolean isKindOfModule(RubyModule type)

isSame

protected boolean isSame(RubyModule module)

initialize

public IRubyObject initialize(Block block)
rb_mod_initialize


attr

public IRubyObject attr(ThreadContext context,
                        IRubyObject[] args)
rb_mod_attr


attr_reader

public IRubyObject attr_reader(IRubyObject[] args)
Deprecated. 


attr_reader

public IRubyObject attr_reader(ThreadContext context,
                               IRubyObject[] args)
rb_mod_attr_reader


attr_writer

public IRubyObject attr_writer(ThreadContext context,
                               IRubyObject[] args)
rb_mod_attr_writer


attr_accessor

public IRubyObject attr_accessor(IRubyObject[] args)
Deprecated. 


attr_accessor

public IRubyObject attr_accessor(ThreadContext context,
                                 IRubyObject[] args)
rb_mod_attr_accessor


instance_methods

public RubyArray instance_methods(IRubyObject[] args)

public_instance_methods

public RubyArray public_instance_methods(IRubyObject[] args)

instance_method

public IRubyObject instance_method(IRubyObject symbol)

protected_instance_methods

public RubyArray protected_instance_methods(IRubyObject[] args)
rb_class_protected_instance_methods


private_instance_methods

public RubyArray private_instance_methods(IRubyObject[] args)
rb_class_private_instance_methods


append_features

public RubyModule append_features(IRubyObject module)
rb_mod_append_features


extend_object

public IRubyObject extend_object(IRubyObject obj)
rb_mod_extend_object


include

public RubyModule include(IRubyObject[] modules)
rb_mod_include


included

public IRubyObject included(ThreadContext context,
                            IRubyObject other)

extended

public IRubyObject extended(ThreadContext context,
                            IRubyObject other,
                            Block block)

rbPublic

public RubyModule rbPublic(ThreadContext context,
                           IRubyObject[] args)
rb_mod_public


rbProtected

public RubyModule rbProtected(ThreadContext context,
                              IRubyObject[] args)
rb_mod_protected


rbPrivate

public RubyModule rbPrivate(ThreadContext context,
                            IRubyObject[] args)
rb_mod_private


module_function

public RubyModule module_function(ThreadContext context,
                                  IRubyObject[] args)
rb_mod_modfunc


method_added

public IRubyObject method_added(ThreadContext context,
                                IRubyObject nothing)

method_removed

public IRubyObject method_removed(ThreadContext context,
                                  IRubyObject nothing)

method_undefined

public IRubyObject method_undefined(ThreadContext context,
                                    IRubyObject nothing)

method_defined_p

public RubyBoolean method_defined_p(ThreadContext context,
                                    IRubyObject symbol)

public_method_defined

public IRubyObject public_method_defined(ThreadContext context,
                                         IRubyObject symbol)

protected_method_defined

public IRubyObject protected_method_defined(ThreadContext context,
                                            IRubyObject symbol)

private_method_defined

public IRubyObject private_method_defined(ThreadContext context,
                                          IRubyObject symbol)

public_class_method

public RubyModule public_class_method(IRubyObject[] args)

private_class_method

public RubyModule private_class_method(IRubyObject[] args)

alias_method

public RubyModule alias_method(ThreadContext context,
                               IRubyObject newId,
                               IRubyObject oldId)

undef_method

public RubyModule undef_method(ThreadContext context,
                               IRubyObject[] args)

module_eval

public IRubyObject module_eval(ThreadContext context,
                               Block block)

module_eval

public IRubyObject module_eval(ThreadContext context,
                               IRubyObject arg0,
                               Block block)

module_eval

public IRubyObject module_eval(ThreadContext context,
                               IRubyObject arg0,
                               IRubyObject arg1,
                               Block block)

module_eval

public IRubyObject module_eval(ThreadContext context,
                               IRubyObject arg0,
                               IRubyObject arg1,
                               IRubyObject arg2,
                               Block block)

module_eval

@Deprecated
public IRubyObject module_eval(ThreadContext context,
                                          IRubyObject[] args,
                                          Block block)
Deprecated. 


remove_method

public RubyModule remove_method(ThreadContext context,
                                IRubyObject[] args)

marshalTo

public static void marshalTo(RubyModule module,
                             MarshalStream output)
                      throws java.io.IOException
Throws:
java.io.IOException

unmarshalFrom

public static RubyModule unmarshalFrom(UnmarshalStream input)
                                throws java.io.IOException
Throws:
java.io.IOException

nesting

public static RubyArray nesting(ThreadContext context,
                                IRubyObject recv,
                                Block block)
Return an array of nested modules or classes.


class_variable_defined_p

public IRubyObject class_variable_defined_p(ThreadContext context,
                                            IRubyObject var)

class_variable_get

public IRubyObject class_variable_get(IRubyObject var)
rb_mod_cvar_get


class_variable_set

public IRubyObject class_variable_set(IRubyObject var,
                                      IRubyObject value)
rb_mod_cvar_set


remove_class_variable

public IRubyObject remove_class_variable(ThreadContext context,
                                         IRubyObject name)
rb_mod_remove_cvar


class_variables

public RubyArray class_variables(ThreadContext context)
rb_mod_class_variables


const_defined_p

public RubyBoolean const_defined_p(ThreadContext context,
                                   IRubyObject symbol)
rb_mod_const_defined


const_get

public IRubyObject const_get(IRubyObject symbol)
rb_mod_const_get


const_set

public IRubyObject const_set(IRubyObject symbol,
                             IRubyObject value)
rb_mod_const_set


remove_const

public IRubyObject remove_const(ThreadContext context,
                                IRubyObject name)

const_missing

public IRubyObject const_missing(ThreadContext context,
                                 IRubyObject name,
                                 Block block)
Base implementation of Module#const_missing, throws NameError for specific missing constant.

Parameters:
name - The constant name which was found to be missing
Returns:
Nothing! Absolutely nothing! (though subclasses might choose to return something)

constants

public RubyArray constants(ThreadContext context)
rb_mod_constants


setClassVar

public IRubyObject setClassVar(java.lang.String name,
                               IRubyObject value)
Set the named class variable to the given value, provided taint and freeze allow setting it. Ruby C equivalent = "rb_cvar_set"

Parameters:
name - The variable name to set
value - The value to set it to

fastSetClassVar

public IRubyObject fastSetClassVar(java.lang.String internedName,
                                   IRubyObject value)

getClassVar

public IRubyObject getClassVar(java.lang.String name)
Retrieve the specified class variable, searching through this module, included modules, and supermodules. Ruby C equivalent = "rb_cvar_get"

Parameters:
name - The name of the variable to retrieve
Returns:
The variable's value, or throws NameError if not found

fastGetClassVar

public IRubyObject fastGetClassVar(java.lang.String internedName)

isClassVarDefined

public boolean isClassVarDefined(java.lang.String name)
Is class var defined? Ruby C equivalent = "rb_cvar_defined"

Parameters:
name - The class var to determine "is defined?"
Returns:
true if true, false if false

fastIsClassVarDefined

public boolean fastIsClassVarDefined(java.lang.String internedName)

removeCvar

public IRubyObject removeCvar(IRubyObject name)
rb_mod_remove_cvar FIXME: any good reason to have two identical methods? (same as remove_class_variable)


getConstantAt

public IRubyObject getConstantAt(java.lang.String name)

fastGetConstantAt

public IRubyObject fastGetConstantAt(java.lang.String internedName)

getConstant

public IRubyObject getConstant(java.lang.String name)
Retrieve the named constant, invoking 'const_missing' should that be appropriate.

Parameters:
name - The constant to retrieve
Returns:
The value for the constant, or null if not found

fastGetConstant

public IRubyObject fastGetConstant(java.lang.String internedName)

getConstantFrom

public IRubyObject getConstantFrom(java.lang.String name)

fastGetConstantFrom

public IRubyObject fastGetConstantFrom(java.lang.String internedName)

setConstant

public IRubyObject setConstant(java.lang.String name,
                               IRubyObject value)
Set the named constant on this module. Also, if the value provided is another Module and that module has not yet been named, assign it the specified name.

Parameters:
name - The name to assign
value - The value to assign to it; if an unnamed Module, also set its basename to name
Returns:
The result of setting the variable.

fastSetConstant

public IRubyObject fastSetConstant(java.lang.String internedName,
                                   IRubyObject value)

defineConstant

public void defineConstant(java.lang.String name,
                           IRubyObject value)
rb_define_const


isConstantDefined

public boolean isConstantDefined(java.lang.String name)
rb_const_defined_at


fastIsConstantDefined

public boolean fastIsConstantDefined(java.lang.String internedName)

hasInternalModuleVariable

public boolean hasInternalModuleVariable(java.lang.String name)
Behaves similarly to getClassVar(String). Searches this class/module and its ancestors for the specified internal variable.

Parameters:
name - the internal variable name
Returns:
the value of the specified internal variable if found, else null
See Also:
setInternalModuleVariable(String, IRubyObject)

searchInternalModuleVariable

public IRubyObject searchInternalModuleVariable(java.lang.String name)
Behaves similarly to getClassVar(String). Searches this class/module and its ancestors for the specified internal variable.

Parameters:
name - the internal variable name
Returns:
the value of the specified internal variable if found, else null
See Also:
setInternalModuleVariable(String, IRubyObject)

setInternalModuleVariable

public void setInternalModuleVariable(java.lang.String name,
                                      IRubyObject value)
Behaves similarly to setClassVar(String, IRubyObject). If the specified internal variable is found in this class/module or an ancestor, it is set where found. Otherwise it is set in this module.

Parameters:
name - the internal variable name
value - the internal variable value
See Also:
searchInternalModuleVariable(String)

hasClassVariable

public boolean hasClassVariable(java.lang.String name)

fastHasClassVariable

public boolean fastHasClassVariable(java.lang.String internedName)

fetchClassVariable

public IRubyObject fetchClassVariable(java.lang.String name)

fastFetchClassVariable

public IRubyObject fastFetchClassVariable(java.lang.String internedName)

storeClassVariable

public IRubyObject storeClassVariable(java.lang.String name,
                                      IRubyObject value)

fastStoreClassVariable

public IRubyObject fastStoreClassVariable(java.lang.String internedName,
                                          IRubyObject value)

deleteClassVariable

public IRubyObject deleteClassVariable(java.lang.String name)

getClassVariableList

public java.util.List<Variable<IRubyObject>> getClassVariableList()

getClassVariableNameList

public java.util.List<java.lang.String> getClassVariableNameList()

validateClassVariable

protected final java.lang.String validateClassVariable(java.lang.String name)

ensureClassVariablesSettable

protected final void ensureClassVariablesSettable()

hasConstant

public boolean hasConstant(java.lang.String name)

fastHasConstant

public boolean fastHasConstant(java.lang.String internedName)

fetchConstant

public IRubyObject fetchConstant(java.lang.String name)

fastFetchConstant

public IRubyObject fastFetchConstant(java.lang.String internedName)

storeConstant

public IRubyObject storeConstant(java.lang.String name,
                                 IRubyObject value)

fastStoreConstant

public IRubyObject fastStoreConstant(java.lang.String internedName,
                                     IRubyObject value)

deleteConstant

public IRubyObject deleteConstant(java.lang.String name)

getStoredConstantList

public java.util.List<Variable<IRubyObject>> getStoredConstantList()

getStoredConstantNameList

public java.util.List<java.lang.String> getStoredConstantNameList()

validateConstant

protected final java.lang.String validateConstant(java.lang.String name)

ensureConstantsSettable

protected final void ensureConstantsSettable()

variableTableStore

protected IRubyObject variableTableStore(java.lang.String name,
                                         IRubyObject value)
Description copied from class: RubyObject
Store a value in the variable store under the specific name.

Overrides:
variableTableStore in class RubyObject

variableTableFastStore

protected IRubyObject variableTableFastStore(java.lang.String internedName,
                                             IRubyObject value)
Description copied from class: RubyObject
Will store the value under the specified name, where the name needs to be an interned Java String.

Overrides:
variableTableFastStore in class RubyObject

variableTableRemove

protected IRubyObject variableTableRemove(java.lang.String name)
Description copied from class: RubyObject
Removes the entry with the specified name from the variable table, and returning the removed value.

Overrides:
variableTableRemove in class RubyObject

variableTableReadLocked

protected IRubyObject variableTableReadLocked(RubyObject.VariableTableEntry entry)
Description copied from class: RubyObject
Reads the value of the specified entry, locked on the current object.

Overrides:
variableTableReadLocked in class RubyObject

variableTableSync

protected void variableTableSync(java.util.List<Variable<IRubyObject>> vars)
Description copied from class: RubyObject
Synchronize the variable table with the argument. In real terms this means copy all entries into a newly allocated table.

Overrides:
variableTableSync in class RubyObject

syncVariables

public void syncVariables(java.util.List<Variable<IRubyObject>> variables)
Description copied from class: RubyObject
Sync one variable table with another - this is used to make rbClone work correctly.

Specified by:
syncVariables in interface IRubyObject
Overrides:
syncVariables in class RubyObject
Parameters:
variables - the variables to be set for object

getVariableMap

@Deprecated
public java.util.Map getVariableMap()
Deprecated. 

Description copied from class: RubyObject
Gets internal access to the getmap for variables.

Overrides:
getVariableMap in class RubyObject

hasVariables

public boolean hasVariables()
Description copied from class: RubyObject
Returns true if object has any variables, defined as:

Specified by:
hasVariables in interface IRubyObject
Overrides:
hasVariables in class RubyObject
Returns:
true if object has any variables, else false

getVariableCount

public int getVariableCount()
Description copied from class: RubyObject
Returns the amount of instance variables, class variables, constants and internal variables this object has.

Specified by:
getVariableCount in interface IRubyObject
Overrides:
getVariableCount in class RubyObject
Returns:
the count of all variables (ivar/cvar/constant/internal)

getVariableList

public java.util.List<Variable<IRubyObject>> getVariableList()
Description copied from class: RubyObject
Gets a list of all variables in this object.

Specified by:
getVariableList in interface IRubyObject
Overrides:
getVariableList in class RubyObject
Returns:
a list of all variables (ivar/cvar/constant/internal)

getVariableNameList

public java.util.List<java.lang.String> getVariableNameList()
Description copied from class: RubyObject
Gets a name list of all variables in this object.

Specified by:
getVariableNameList in interface IRubyObject
Overrides:
getVariableNameList in class RubyObject
Returns:
a list of all variable names (ivar/cvar/constant/internal)

constantTableContains

protected boolean constantTableContains(java.lang.String name)

constantTableFastContains

protected boolean constantTableFastContains(java.lang.String internedName)

constantTableFetch

protected IRubyObject constantTableFetch(java.lang.String name)

constantTableFastFetch

protected IRubyObject constantTableFastFetch(java.lang.String internedName)

constantTableStore

protected IRubyObject constantTableStore(java.lang.String name,
                                         IRubyObject value)

constantTableFastStore

protected IRubyObject constantTableFastStore(java.lang.String internedName,
                                             IRubyObject value)

constantTableRemove

protected IRubyObject constantTableRemove(java.lang.String name)

constantTableGetTable

protected RubyModule.ConstantTableEntry[] constantTableGetTable()

constantTableGetSize

protected int constantTableGetSize()

constantTableSync

protected void constantTableSync(java.util.List<Variable<IRubyObject>> vars)

constantTableGetMap

protected java.util.Map constantTableGetMap()
Method to help ease transition to new variables implementation. Will likely be deprecated in the near future.


constantTableGetMap

protected java.util.Map constantTableGetMap(java.util.Map map)
Method to help ease transition to new variables implementation. Will likely be deprecated in the near future.



Copyright © 2002-2007 JRuby Team. All Rights Reserved.