org.jruby
Class MetaClass

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

public final class MetaClass
extends RubyClass

See Also:
Serialized Form

Nested 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.RubyModule
classId, CONSTANT_TABLE_DEFAULT_CAPACITY, CONSTANT_TABLE_LOAD_FACTOR, CONSTANT_TABLE_MAXIMUM_CAPACITY, constantTable, constantTableSize, constantTableThreshold, dispatcher, ERR_FROZEN_CONST_TYPE, ERR_FROZEN_CVAR_TYPE, ERR_INSECURE_SET_CLASS_VAR, ERR_INSECURE_SET_CONSTANT, id, index, kindOf, parent, superClass, variableWriteLock
 
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
MetaClass(Ruby runtime)
          NEWOBJ (in RubyObject#getSingletonClassClone())
MetaClass(Ruby runtime, RubyClass superClass)
          rb_class_boot (for MetaClasses) (in makeMetaClass(RubyClass))
 
Method Summary
 IRubyObject allocate()
           
 IRubyObject getAttached()
           
 RubyClass getRealClass()
          If an object uses an anonymous class 'class << obj', then this grabs the original metaclass and not the one that get injected as a result of 'class << obj'.
 boolean isSingleton()
           
 void setAttached(IRubyObject attached)
           
 
Methods inherited from class org.jruby.RubyClass
addSubclass, checkInheritable, createBootstrapClass, createClassClass, getAllocator, getClassRuntime, getMarshal, getNativeTypeIndex, inherit, inherited, initialize_copy, initialize, invoke, invoke, invoke, invokeInherited, isClass, isModule, makeMetaClass, marshal, marshalTo, newClass, newClass, newInstance, setAllocator, setMarshal, subclasses, subclasses, superclass, unmarshal, unmarshalFrom
 
Methods inherited from class org.jruby.RubyModule
addClassProvider, addMethod, addModuleFunction, alias_method, ancestors, append_features, attr_accessor, attr_accessor, attr_reader, attr_reader, attr_writer, attr, class_variable_defined_p, class_variable_get, class_variable_set, class_variables, cloneMethods, const_defined_p, const_get, const_missing, const_set, constants, constantTableContains, constantTableFastContains, constantTableFastFetch, constantTableFastStore, constantTableFetch, constantTableGetMap, constantTableGetMap, constantTableGetSize, constantTableGetTable, constantTableRemove, constantTableStore, constantTableSync, createModuleClass, define_method, defineAlias, defineAliases, defineAnnotatedConstant, defineAnnotatedConstants, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethods, defineAnnotatedMethodsIndividually, defineClassUnder, defineConstant, defineFastMethod, defineFastMethod, defineFastModuleFunction, defineFastPrivateMethod, defineFastProtectedMethod, defineFastPublicModuleFunction, defineMethod, defineModuleFunction, defineModuleUnder, defineOrGetClassUnder, defineOrGetModuleUnder, definePrivateMethod, definePublicModuleFunction, deleteClassVariable, deleteConstant, ensureClassVariablesSettable, ensureConstantsSettable, executeUnder, exportMethod, extend_object, extended, fastFetchClassVariable, fastFetchConstant, fastGetClass, fastGetClassVar, fastGetConstant, fastGetConstantAt, fastGetConstantFrom, fastHasClassVariable, fastHasConstant, fastIsClassVarDefined, fastIsConstantDefined, fastSetClassVar, fastSetConstant, fastStoreClassVariable, fastStoreConstant, fetchClassVariable, fetchConstant, findImplementer, freeze, getAncestorList, getBaseName, getClass, getClassVar, getClassVariableList, getClassVariableNameList, getConstant, getConstantAt, getConstantFrom, getDispatcher, getMethods, getName, getNonIncludedClass, getParent, getStoredConstantList, getStoredConstantNameList, getSuperClass, getVariableCount, getVariableList, getVariableMap, getVariableNameList, hasClassVariable, hasConstant, hash, hashCode, hasInternalModuleVariable, hasModuleInHierarchy, hasVariables, include_p, include, included_modules, included, includeModule, initialize, instance_method, instance_methods, isClassVarDefined, isConstantDefined, isIncluded, isInstance, isKindOfModule, isMethodBound, isSame, marshalTo, method_added, method_defined_p, method_removed, method_undefined, module_eval, module_function, name, needsImplementer, nesting, newIncludeClass, newMethod, newModule, newModule, op_cmp, op_eqq, op_equal, op_ge, op_gt, op_le, op_lt, private_class_method, private_instance_methods, private_method_defined, protected_instance_methods, protected_method_defined, public_class_method, public_instance_methods, public_method_defined, rbPrivate, rbProtected, rbPublic, remove_class_variable, remove_const, remove_method, removeClassProvider, removeCvar, removeMethod, retrieveMethod, searchInternalModuleVariable, searchMethod, setBaseName, setClassVar, setConstant, setInternalModuleVariable, setMethodVisibility, setParent, setSuperClass, storeClassVariable, storeConstant, syncVariables, to_s, undef_method, undef, undefineMethod, validateClassVariable, validateConstant, variableTableFastStore, variableTableReadLocked, variableTableRemove, variableTableStore, variableTableSync
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, 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, 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_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, method, methods, nil_p, op_eqq, 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, taint, tainted_p, testFrozen, to_a, 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
 

Constructor Detail

MetaClass

public MetaClass(Ruby runtime)
NEWOBJ (in RubyObject#getSingletonClassClone())


MetaClass

public MetaClass(Ruby runtime,
                 RubyClass superClass)
rb_class_boot (for MetaClasses) (in makeMetaClass(RubyClass))

Method Detail

isSingleton

public boolean isSingleton()
Overrides:
isSingleton in class RubyClass

getRealClass

public RubyClass getRealClass()
If an object uses an anonymous class 'class << obj', then this grabs the original metaclass and not the one that get injected as a result of 'class << obj'.

Overrides:
getRealClass in class RubyClass

allocate

public final IRubyObject allocate()
Overrides:
allocate in class RubyClass

getAttached

public IRubyObject getAttached()

setAttached

public void setAttached(IRubyObject attached)


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