|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
public class RubyObject
Nested Class Summary | |
---|---|
class |
RubyObject.Finalizer
|
Field Summary | |
---|---|
protected java.util.Map |
instanceVariables
|
protected boolean |
isTrue
|
protected RubyClass |
metaClass
|
static IRubyObject |
NEVER
|
static ObjectAllocator |
OBJECT_ALLOCATOR
|
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
RubyObject(Ruby runtime,
RubyClass metaClass)
|
|
RubyObject(Ruby runtime,
RubyClass metaClass,
boolean useObjectSpace)
|
Method Summary | |
---|---|
void |
addFinalizer(RubyProc finalizer)
|
IRubyObject |
anyToString()
|
RubyString |
asString()
rb_obj_as_string |
java.lang.String |
asSymbol()
rb_to_id |
void |
attachToObjectSpace()
|
void |
callInit(IRubyObject[] args,
Block block)
|
IRubyObject |
callMethod(ThreadContext context,
int methodIndex,
java.lang.String name)
|
IRubyObject |
callMethod(ThreadContext context,
int methodIndex,
java.lang.String name,
IRubyObject arg)
|
IRubyObject |
callMethod(ThreadContext context,
int methodIndex,
java.lang.String name,
IRubyObject[] args)
|
IRubyObject |
callMethod(ThreadContext context,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType)
|
IRubyObject |
callMethod(ThreadContext context,
RubyModule rubyclass,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType)
|
IRubyObject |
callMethod(ThreadContext context,
RubyModule rubyclass,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
IRubyObject |
callMethod(ThreadContext context,
RubyModule rubyclass,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
IRubyObject |
callMethod(ThreadContext context,
java.lang.String name)
|
IRubyObject |
callMethod(ThreadContext context,
java.lang.String name,
Block block)
|
IRubyObject |
callMethod(ThreadContext context,
java.lang.String name,
IRubyObject arg)
rb_funcall |
IRubyObject |
callMethod(ThreadContext context,
java.lang.String name,
IRubyObject[] args)
|
IRubyObject |
callMethod(ThreadContext context,
java.lang.String name,
IRubyObject[] args,
Block block)
|
IRubyObject |
callMethod(ThreadContext context,
java.lang.String name,
IRubyObject[] args,
CallType callType)
|
IRubyObject |
callMethod(ThreadContext context,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
static IRubyObject |
callMethodMissing(ThreadContext context,
IRubyObject receiver,
DynamicMethod method,
java.lang.String name,
int methodIndex,
IRubyObject[] args,
IRubyObject self,
CallType callType,
Block block)
|
static IRubyObject |
callMethodMissing(ThreadContext context,
IRubyObject receiver,
DynamicMethod method,
java.lang.String name,
IRubyObject[] args,
IRubyObject self,
CallType callType,
Block block)
|
IRubyObject |
callSuper(ThreadContext context,
IRubyObject[] args,
Block block)
|
IRubyObject |
checkArrayType()
rb_check_array_type |
protected void |
checkFrozen()
|
IRubyObject |
checkStringType()
rb_check_string_type |
IRubyObject |
compilerCallMethod(ThreadContext context,
java.lang.String name,
IRubyObject[] args,
IRubyObject self,
CallType callType,
Block block)
Used by the compiler to handle visibility |
IRubyObject |
compilerCallMethodWithIndex(ThreadContext context,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
IRubyObject self,
CallType callType,
Block block)
Used by the compiler to ease calling indexed methods, also to handle visibility. |
RubyArray |
convertToArray()
Methods which perform to_xxx if the object has such a method |
RubyFloat |
convertToFloat()
|
RubyHash |
convertToHash()
|
RubyInteger |
convertToInteger()
|
RubyString |
convertToString()
|
IRubyObject |
convertToType(RubyClass targetType,
int convertMethodIndex,
boolean raise)
|
IRubyObject |
convertToType(RubyClass targetType,
int convertMethodIndex,
java.lang.String convertMethod,
boolean raise)
Converts this object to type 'targetType' using 'convertMethod' method (MRI: convert_type). |
IRubyObject |
convertToType(RubyClass targetType,
int convertMethodIndex,
java.lang.String convertMethod,
boolean raiseOnMissingMethod,
boolean raiseOnWrongTypeResult,
boolean allowNilThrough)
|
IRubyObject |
convertToTypeWithCheck(RubyClass targetType,
int convertMethodIndex,
java.lang.String convertMethod)
Higher level conversion utility similiar to convertToType but it can throw an additional TypeError during conversion (MRI: rb_check_convert_type). |
static RubyClass |
createObjectClass(Ruby runtime,
RubyClass objectClass)
|
java.lang.Object |
dataGetStruct()
Our version of Data_Get_Struct. |
void |
dataWrapStruct(java.lang.Object obj)
Our version of Data_Wrap_Struct. |
IRubyObject |
display(IRubyObject[] args)
|
protected IRubyObject |
doClone()
|
IRubyObject |
dup()
rb_obj_dup should be overriden only by: Proc |
boolean |
eql(IRubyObject other)
rb_eql this method is not defind for Ruby objects directly. |
boolean |
eqlInternal(ThreadContext context,
IRubyObject other)
|
IRubyObject |
equal(IRubyObject other)
rb_equal |
IRubyObject |
equalInternal(ThreadContext context,
IRubyObject other)
|
boolean |
equals(java.lang.Object other)
This method is just a wrapper around the Ruby "==" method, provided so that RubyObjects can be used as keys in the Java HashMap object underlying RubyHash. |
IRubyObject |
evalSimple(ThreadContext context,
IRubyObject src,
java.lang.String file)
Evaluate the given string. |
IRubyObject |
evalUnder(RubyModule under,
IRubyObject src,
IRubyObject file,
IRubyObject line)
|
IRubyObject |
evalWithBinding(ThreadContext context,
IRubyObject src,
IRubyObject scope,
java.lang.String file,
int lineNumber)
Evaluate the given string under the specified binding object. |
IRubyObject |
extend(IRubyObject[] args)
|
IRubyObject |
freeze()
Freeze an object. |
RubyBoolean |
frozen()
rb_obj_frozen_p |
IRubyObject |
getInstanceVariable(java.lang.String name)
RubyMethod getInstanceVar. |
java.util.Map |
getInstanceVariables()
|
java.util.Map |
getInstanceVariablesSnapshot()
Returns an unmodifiable snapshot of the current state of instance variables. |
java.lang.Class |
getJavaClass()
RubyMethod getJavaClass. |
RubyClass |
getMetaClass()
if exist return the meta-class else return the type of the object. |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. |
Ruby |
getRuntime()
Getter for property ruby. |
RubyClass |
getSingletonClass()
rb_singleton_class |
RubyClass |
getSingletonClassClone()
rb_singleton_class_clone |
RubyClass |
getType()
RubyMethod getType. |
RubyFixnum |
hash()
|
int |
hashCode()
|
RubyFixnum |
id_deprecated()
|
RubyFixnum |
id()
Return the internal id of an object. |
IRubyObject |
infectBy(IRubyObject obj)
OBJ_INFECT |
IRubyObject |
inherited(IRubyObject arg,
Block block)
|
static void |
initCopy(IRubyObject clone,
IRubyObject original)
init_copy |
IRubyObject |
initialize_copy(IRubyObject original)
rb_obj_init_copy |
IRubyObject |
initialize(IRubyObject[] args,
Block block)
|
IRubyObject |
inspect()
rb_obj_inspect |
IRubyObject |
instance_eval(IRubyObject[] args,
Block block)
|
IRubyObject |
instance_exec(IRubyObject[] args,
Block block)
|
RubyBoolean |
instance_of(IRubyObject type)
rb_obj_is_instance_of |
IRubyObject |
instance_variable_get(IRubyObject var)
|
IRubyObject |
instance_variable_set(IRubyObject var,
IRubyObject value)
|
RubyArray |
instance_variables()
|
java.util.Iterator |
instanceVariableNames()
|
boolean |
isFalse()
|
boolean |
isFrozen()
Gets the frozen. |
boolean |
isImmediate()
|
boolean |
isKindOf(RubyModule type)
RubyMethod isKindOf. |
boolean |
isNil()
RubyMethod isNil. |
boolean |
isSingleton()
|
boolean |
isTaint()
Gets the taint. |
boolean |
isTrue()
|
RubyBoolean |
kind_of(IRubyObject type)
rb_obj_is_kind_of |
RubyClass |
makeMetaClass(RubyClass superClass,
SinglyLinkedList parentCRef)
Create a new meta class. |
IRubyObject |
match(IRubyObject arg)
|
IRubyObject |
method(IRubyObject symbol)
|
IRubyObject |
methods(IRubyObject[] args)
rb_obj_methods |
IRubyObject |
nil_p()
|
IRubyObject |
obj_equal(IRubyObject obj)
rb_obj_equal |
IRubyObject |
private_methods(IRubyObject[] args)
rb_obj_private_methods |
IRubyObject |
protected_methods(IRubyObject[] args)
rb_obj_protected_methods |
IRubyObject |
public_methods(IRubyObject[] args)
|
static void |
puts(java.lang.Object obj)
|
IRubyObject |
rbClone(Block unusedBlock)
rb_obj_clone should be overriden only by: Proc, Method, UnboundedMethod, Binding |
IRubyObject |
remove_instance_variable(IRubyObject name,
Block block)
|
void |
removeFinalizers()
|
IRubyObject |
removeInstanceVariable(java.lang.String name)
|
RubyBoolean |
respond_to(IRubyObject[] args)
respond_to?( aSymbol, includePriv=false ) -> true or false Returns true if this object responds to the given method. |
boolean |
respondsTo(java.lang.String name)
RubyMethod respondsTo. |
java.util.Map |
safeGetInstanceVariables()
Gets a copy of the instance variables for this object, if any exist. |
boolean |
safeHasInstanceVariables()
Returns true if the object has any instance variables, false otherwise. |
IRubyObject |
send(IRubyObject[] args,
Block block)
send( aSymbol [, args ]* ) -> anObject Invokes the method identified by aSymbol, passing it any arguments specified. |
void |
setFrozen(boolean frozen)
Sets the frozen. |
IRubyObject |
setInstanceVariable(java.lang.String name,
IRubyObject value)
rb_iv_set / rb_ivar_set |
IRubyObject |
setInstanceVariable(java.lang.String name,
IRubyObject value,
java.lang.String taintError,
java.lang.String freezeError)
|
void |
setInstanceVariables(java.util.Map instanceVariables)
|
void |
setMetaClass(RubyClass metaClass)
|
void |
setTaint(boolean taint)
Sets the taint. |
RubyArray |
singleton_methods(IRubyObject[] args)
rb_obj_singleton_methods |
IRubyObject |
specificEval(RubyModule mod,
IRubyObject[] args,
Block block)
specific_eval |
IRubyObject |
taint()
rb_obj_taint |
RubyBoolean |
tainted()
rb_obj_tainted |
protected void |
testFrozen(java.lang.String message)
rb_frozen_class_p |
IRubyObject |
to_s()
|
java.lang.String |
toString()
|
static java.lang.String |
trueFalseNil(IRubyObject v)
|
static java.lang.String |
trueFalseNil(java.lang.String v)
|
RubyClass |
type_deprecated()
|
RubyClass |
type()
rb_obj_type |
IRubyObject |
untaint()
rb_obj_untaint |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final IRubyObject NEVER
protected RubyClass metaClass
protected java.util.Map instanceVariables
protected boolean isTrue
public static ObjectAllocator OBJECT_ALLOCATOR
Constructor Detail |
---|
public RubyObject(Ruby runtime, RubyClass metaClass)
public RubyObject(Ruby runtime, RubyClass metaClass, boolean useObjectSpace)
Method Detail |
---|
public static RubyClass createObjectClass(Ruby runtime, RubyClass objectClass)
public void attachToObjectSpace()
public int getNativeTypeIndex()
getNativeTypeIndex
in interface IRubyObject
public boolean isImmediate()
isImmediate
in interface IRubyObject
public RubyClass makeMetaClass(RubyClass superClass, SinglyLinkedList parentCRef)
public boolean isSingleton()
isSingleton
in interface IRubyObject
public java.lang.Class getJavaClass()
IRubyObject
getJavaClass
in interface IRubyObject
public static void puts(java.lang.Object obj)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Ruby getRuntime()
getRuntime
in interface IRubyObject
public boolean safeHasInstanceVariables()
IRubyObject
safeHasInstanceVariables
in interface IRubyObject
public java.util.Map safeGetInstanceVariables()
IRubyObject
safeGetInstanceVariables
in interface IRubyObject
public IRubyObject removeInstanceVariable(java.lang.String name)
public java.util.Map getInstanceVariablesSnapshot()
getInstanceVariablesSnapshot
in interface IRubyObject
public java.util.Map getInstanceVariables()
getInstanceVariables
in interface IRubyObject
public void setInstanceVariables(java.util.Map instanceVariables)
setInstanceVariables
in interface IRubyObject
public final RubyClass getMetaClass()
getMetaClass
in interface IRubyObject
public void setMetaClass(RubyClass metaClass)
setMetaClass
in interface IRubyObject
public boolean isFrozen()
isFrozen
in interface IRubyObject
public void setFrozen(boolean frozen)
setFrozen
in interface IRubyObject
frozen
- The frozen to setprotected void testFrozen(java.lang.String message)
protected void checkFrozen()
public boolean isTaint()
isTaint
in interface IRubyObject
public void setTaint(boolean taint)
setTaint
in interface IRubyObject
taint
- The taint to setpublic boolean isNil()
IRubyObject
isNil
in interface IRubyObject
public final boolean isTrue()
isTrue
in interface IRubyObject
public final boolean isFalse()
public boolean respondsTo(java.lang.String name)
IRubyObject
respondsTo
in interface IRubyObject
public boolean isKindOf(RubyModule type)
IRubyObject
isKindOf
in interface IRubyObject
public RubyClass getSingletonClass()
getSingletonClass
in interface IRubyObject
public RubyClass getSingletonClassClone()
public static void initCopy(IRubyObject clone, IRubyObject original)
public IRubyObject infectBy(IRubyObject obj)
infectBy
in interface IRubyObject
public IRubyObject callSuper(ThreadContext context, IRubyObject[] args, Block block)
callSuper
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject[] args)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject[] args, Block block)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject[] args, CallType callType)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, int methodIndex, java.lang.String name, IRubyObject arg)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, int methodIndex, java.lang.String name, IRubyObject[] args)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType)
callMethod
in interface IRubyObject
public IRubyObject compilerCallMethodWithIndex(ThreadContext context, int methodIndex, java.lang.String name, IRubyObject[] args, IRubyObject self, CallType callType, Block block)
compilerCallMethodWithIndex
in interface IRubyObject
public IRubyObject compilerCallMethod(ThreadContext context, java.lang.String name, IRubyObject[] args, IRubyObject self, CallType callType, Block block)
compilerCallMethod
in interface IRubyObject
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, DynamicMethod method, java.lang.String name, int methodIndex, IRubyObject[] args, IRubyObject self, CallType callType, Block block)
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, DynamicMethod method, java.lang.String name, IRubyObject[] args, IRubyObject self, CallType callType, Block block)
public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType)
public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, java.lang.String name)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, int methodIndex, java.lang.String name)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, java.lang.String name, Block block)
callMethod
in interface IRubyObject
public IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject arg)
callMethod
in interface IRubyObject
public IRubyObject instance_variable_get(IRubyObject var)
public IRubyObject getInstanceVariable(java.lang.String name)
IRubyObject
getInstanceVariable
in interface IRubyObject
public IRubyObject instance_variable_set(IRubyObject var, IRubyObject value)
public IRubyObject setInstanceVariable(java.lang.String name, IRubyObject value, java.lang.String taintError, java.lang.String freezeError)
public IRubyObject setInstanceVariable(java.lang.String name, IRubyObject value)
setInstanceVariable
in interface IRubyObject
public java.util.Iterator instanceVariableNames()
instanceVariableNames
in interface IRubyObject
public void callInit(IRubyObject[] args, Block block)
public java.lang.String asSymbol()
asSymbol
in interface IRubyObject
public static java.lang.String trueFalseNil(IRubyObject v)
public static java.lang.String trueFalseNil(java.lang.String v)
public RubyArray convertToArray()
IRubyObject
convertToArray
in interface IRubyObject
public RubyHash convertToHash()
convertToHash
in interface IRubyObject
public RubyFloat convertToFloat()
convertToFloat
in interface IRubyObject
public RubyInteger convertToInteger()
convertToInteger
in interface IRubyObject
public RubyString convertToString()
convertToString
in interface IRubyObject
public IRubyObject convertToTypeWithCheck(RubyClass targetType, int convertMethodIndex, java.lang.String convertMethod)
IRubyObject
convertToTypeWithCheck
in interface IRubyObject
targetType
- is the type we are trying to convert toconvertMethod
- is the method to be called to try and convert to targeType
public IRubyObject convertToType(RubyClass targetType, int convertMethodIndex, java.lang.String convertMethod, boolean raise)
IRubyObject
convertToType
in interface IRubyObject
targetType
- is the type we are trying to convert toconvertMethod
- is the method to be called to try and convert to targeTyperaise
- will throw an Error if conversion does not work
public IRubyObject convertToType(RubyClass targetType, int convertMethodIndex, boolean raise)
public IRubyObject convertToType(RubyClass targetType, int convertMethodIndex, java.lang.String convertMethod, boolean raiseOnMissingMethod, boolean raiseOnWrongTypeResult, boolean allowNilThrough)
convertToType
in interface IRubyObject
public RubyString asString()
asString
in interface IRubyObject
public IRubyObject checkStringType()
checkStringType
in interface IRubyObject
public IRubyObject checkArrayType()
checkArrayType
in interface IRubyObject
public IRubyObject specificEval(RubyModule mod, IRubyObject[] args, Block block)
public IRubyObject evalUnder(RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line)
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, java.lang.String file, int lineNumber)
IRubyObject
evalWithBinding
in interface IRubyObject
context
- TODOsrc
- The string containing the text to be evaluatedscope
- The binding object under which to perform the evaluationfile
- The filename to use when reporting errors during the evaluationlineNumber
- is the line number to pretend we are starting from
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, java.lang.String file)
IRubyObject
evalSimple
in interface IRubyObject
context
- TODOsrc
- The string containing the text to be evaluatedfile
- The filename to use when reporting errors during the evaluation
public IRubyObject obj_equal(IRubyObject obj)
public IRubyObject equal(IRubyObject other)
equal
in interface IRubyObject
public final IRubyObject equalInternal(ThreadContext context, IRubyObject other)
equalInternal
in interface IRubyObject
public boolean eql(IRubyObject other)
eql
in interface IRubyObject
public final boolean eqlInternal(ThreadContext context, IRubyObject other)
eqlInternal
in interface IRubyObject
public IRubyObject initialize_copy(IRubyObject original)
public RubyBoolean respond_to(IRubyObject[] args)
public RubyFixnum id()
id
in interface IRubyObject
public RubyFixnum id_deprecated()
public RubyFixnum hash()
public int hashCode()
hashCode
in class java.lang.Object
public RubyClass type()
public RubyClass type_deprecated()
public IRubyObject rbClone(Block unusedBlock)
rbClone
in interface IRubyObject
protected IRubyObject doClone()
public IRubyObject display(IRubyObject[] args)
public IRubyObject dup()
dup
in interface IRubyObject
public RubyBoolean tainted()
public IRubyObject taint()
public IRubyObject untaint()
public IRubyObject freeze()
public RubyBoolean frozen()
public IRubyObject inspect()
inspect
in interface IRubyObject
public RubyBoolean instance_of(IRubyObject type)
public RubyArray instance_variables()
public RubyBoolean kind_of(IRubyObject type)
public IRubyObject methods(IRubyObject[] args)
public IRubyObject public_methods(IRubyObject[] args)
public IRubyObject protected_methods(IRubyObject[] args)
public IRubyObject private_methods(IRubyObject[] args)
public RubyArray singleton_methods(IRubyObject[] args)
public IRubyObject method(IRubyObject symbol)
public IRubyObject anyToString()
anyToString
in interface IRubyObject
public IRubyObject to_s()
public IRubyObject instance_eval(IRubyObject[] args, Block block)
public IRubyObject instance_exec(IRubyObject[] args, Block block)
public IRubyObject extend(IRubyObject[] args)
public IRubyObject inherited(IRubyObject arg, Block block)
public IRubyObject initialize(IRubyObject[] args, Block block)
public IRubyObject send(IRubyObject[] args, Block block)
class Klass def hello(*args) "Hello " + args.join(' ') end end k = Klass.new k.send :hello, "gentle", "readers"
public IRubyObject nil_p()
public IRubyObject match(IRubyObject arg)
public IRubyObject remove_instance_variable(IRubyObject name, Block block)
public RubyClass getType()
IRubyObject
getType
in interface IRubyObject
IRubyObject.getType()
public void dataWrapStruct(java.lang.Object obj)
IRubyObject
dataWrapStruct
in interface IRubyObject
obj
- the object to wraporg.jruby.runtime.builtin.IRubyObject#dataWrapStruct()
public java.lang.Object dataGetStruct()
IRubyObject
dataGetStruct
in interface IRubyObject
IRubyObject.dataGetStruct()
public void addFinalizer(RubyProc finalizer)
addFinalizer
in interface IRubyObject
public void removeFinalizers()
removeFinalizers
in interface IRubyObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |