org.jruby.runtime.builtin
Interface IRubyObject

All Known Subinterfaces:
JavaProxyMethod
All Known Implementing Classes:
AbstractBuffer, AbstractMemory, AbstractMemoryPointer, ArrayJavaProxy, AutoPointer, CallbackInfo, ConcreteJavaProxy, FFIProvider, FiberLibrary.Fiber, FileDescriptorIO, IncludedModuleWrapper, InterfaceJavaProxy, Invoker, JavaAccessibleObject, JavaArray, JavaCallable, JavaClass, JavaConstructor, JavaField, JavaMethod, JavaObject, JavaProxy, JavaProxyClass, JavaProxyClass.ProxyMethodImpl, JavaProxyConstructor, JavaProxyReflectionObject, JNABasePointer, JNABuffer, JNAMemoryPointer, JNAProvider, JNAVariadicInvoker, JRubyObjectInputStream, MetaClass, MiniJava.JavaObjectWrapper, MockRubyObject, NativeException, Pointer, RubyArray, RubyBasicObject, RubyBasicSocket, RubyBigDecimal, RubyBignum, RubyBinding, RubyBoolean, RubyClass, RubyClassPathVariable, RubyComplex, RubyDigest.Base, RubyDir, RubyEncoding, RubyEnumerator, RubyException, RubyFile, RubyFileStat, RubyFixnum, RubyFloat, RubyGlobal.StringOnlyRubyHash, RubyHash, RubyIconv, RubyIconv.RubyFailure, RubyInteger, RubyIO, RubyIPSocket, RubyLocalJumpError, RubyMatchData, RubyMethod, RubyModule, RubyNameError, RubyNameError.RubyNameErrorMessage, RubyNil, RubyNoMethodError, RubyNumeric, RubyObject, RubyProc, RubyProcess.RubyStatus, RubyRange, RubyRational, RubyRegexp, RubySocket, RubyString, RubyStringIO, RubyStringScanner, RubyStruct, RubySymbol, RubySystemCallError, RubySystemExit, RubyTCPServer, RubyTCPSocket, RubyThread, RubyThreadGroup, RubyTime, RubyUDPSocket, RubyUnboundMethod, RubyUNIXServer, RubyUNIXSocket, RubyZlib.Deflate, RubyZlib.Inflate, RubyZlib.RubyGzipFile, RubyZlib.RubyGzipReader, RubyZlib.RubyGzipWriter, RubyZlib.ZStream, StructLayout, StructLayoutBuilder, ThreadLibrary.ConditionVariable, ThreadLibrary.Mutex, ThreadLibrary.Queue, ThreadLibrary.SizedQueue, WeakRef

public interface IRubyObject

Object is the parent class of all classes in Ruby. Its methods are therefore available to all objects unless explicitly overridden.


Field Summary
static IRubyObject[] NULL_ARRAY
           
 
Method Summary
 void addFinalizer(IRubyObject finalizer)
           
 IRubyObject anyToString()
           
 java.lang.String asJavaString()
          Convert the object into a symbol name if possible.
 RubyString asString()
          rb_obj_as_string
 IRubyObject callMethod(ThreadContext context, int methodIndex, java.lang.String name)
          Deprecated. 
 IRubyObject callMethod(ThreadContext context, int methodIndex, java.lang.String name, IRubyObject arg)
          Deprecated. 
 IRubyObject callMethod(ThreadContext context, java.lang.String name)
           
 IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject arg)
           
 IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject[] args)
           
 IRubyObject callMethod(ThreadContext context, java.lang.String name, IRubyObject[] args, Block block)
           
 IRubyObject callSuper(ThreadContext context, IRubyObject[] args, Block block)
          Deprecated. 
 IRubyObject checkArrayType()
           
 IRubyObject checkStringType()
           
 RubyArray convertToArray()
          Methods which perform to_xxx if the object has such a method
 RubyFloat convertToFloat()
           
 RubyHash convertToHash()
           
 RubyInteger convertToInteger()
           
 RubyInteger convertToInteger(int convertMethodIndex, java.lang.String convertMethod)
          Deprecated. 
 RubyInteger convertToInteger(java.lang.String convertMethod)
           
 RubyString convertToString()
           
 void copySpecialInstanceVariables(IRubyObject clone)
           
 java.lang.Object dataGetStruct()
          Our version of Data_Get_Struct.
 void dataWrapStruct(java.lang.Object obj)
          Our version of Data_Wrap_Struct.
 IRubyObject dup()
          RubyMethod dup.
 boolean eql(IRubyObject other)
           
 InstanceVariables getInstanceVariables()
           
 InternalVariables getInternalVariables()
           
 java.lang.Class getJavaClass()
          RubyMethod getJavaClass.
 RubyClass getMetaClass()
          RubyMethod getRubyClass.
 Ruby getRuntime()
          RubyMethod getRuntime.
 RubyClass getSingletonClass()
          RubyMethod getSingletonClass.
 RubyClass getType()
          RubyMethod getType.
 int getVariableCount()
           
 java.util.List<Variable<IRubyObject>> getVariableList()
           
 java.util.List<java.lang.String> getVariableNameList()
           
 boolean hasVariables()
          Returns true if object has any variables, defined as: instance variables class variables constants internal variables, such as those used when marshalling Ranges and Exceptions
 IRubyObject id()
           
 IRubyObject infectBy(IRubyObject obj)
          Infect this object using the taint of another object
 IRubyObject inspect()
          RubyMethod inspect.
 boolean isClass()
           
 boolean isFrozen()
          RubyMethod isFrozen.
 boolean isImmediate()
           
 boolean isModule()
           
 boolean isNil()
          RubyMethod isNil.
 boolean isTaint()
          RubyMethod isTaint.
 boolean isTrue()
           
 IRubyObject op_eqq(ThreadContext context, IRubyObject other)
           
 IRubyObject op_equal(ThreadContext context, IRubyObject other)
           
 IRubyObject rbClone()
          RubyMethod rbClone.
 void removeFinalizers()
           
 boolean respondsTo(java.lang.String string)
          RubyMethod respondsTo.
 void setFrozen(boolean b)
          RubyMethod setFrozen.
 void setTaint(boolean b)
          RubyMethod setTaint.
 void syncVariables(java.util.List<Variable<IRubyObject>> variables)
          Sets object's variables to those in the supplied list, removing/replacing any previously defined variables.
 

Field Detail

NULL_ARRAY

static final IRubyObject[] NULL_ARRAY
Method Detail

callSuper

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


callMethod

IRubyObject callMethod(ThreadContext context,
                       java.lang.String name)

callMethod

IRubyObject callMethod(ThreadContext context,
                       java.lang.String name,
                       IRubyObject arg)

callMethod

IRubyObject callMethod(ThreadContext context,
                       java.lang.String name,
                       IRubyObject[] args)

callMethod

IRubyObject callMethod(ThreadContext context,
                       java.lang.String name,
                       IRubyObject[] args,
                       Block block)

callMethod

@Deprecated
IRubyObject callMethod(ThreadContext context,
                                  int methodIndex,
                                  java.lang.String name)
Deprecated. 


callMethod

@Deprecated
IRubyObject callMethod(ThreadContext context,
                                  int methodIndex,
                                  java.lang.String name,
                                  IRubyObject arg)
Deprecated. 


isNil

boolean isNil()
RubyMethod isNil.

Returns:
boolean

isTrue

boolean isTrue()
Returns:

isTaint

boolean isTaint()
RubyMethod isTaint.

Returns:
boolean

setTaint

void setTaint(boolean b)
RubyMethod setTaint.

Parameters:
b -

infectBy

IRubyObject infectBy(IRubyObject obj)
Infect this object using the taint of another object

Parameters:
obj -
Returns:

isFrozen

boolean isFrozen()
RubyMethod isFrozen.

Returns:
boolean

setFrozen

void setFrozen(boolean b)
RubyMethod setFrozen.

Parameters:
b -

isImmediate

boolean isImmediate()
Returns:

getMetaClass

RubyClass getMetaClass()
RubyMethod getRubyClass.

Returns:

getSingletonClass

RubyClass getSingletonClass()
RubyMethod getSingletonClass.

Returns:
RubyClass

getType

RubyClass getType()
RubyMethod getType.

Returns:
RubyClass

respondsTo

boolean respondsTo(java.lang.String string)
RubyMethod respondsTo.

Parameters:
string -
Returns:
boolean

getRuntime

Ruby getRuntime()
RubyMethod getRuntime.

Returns:

getJavaClass

java.lang.Class getJavaClass()
RubyMethod getJavaClass.

Returns:
Class

asJavaString

java.lang.String asJavaString()
Convert the object into a symbol name if possible.

Returns:
String the symbol name

asString

RubyString asString()
rb_obj_as_string

Returns:

convertToArray

RubyArray convertToArray()
Methods which perform to_xxx if the object has such a method

Returns:

convertToHash

RubyHash convertToHash()
Returns:

convertToFloat

RubyFloat convertToFloat()
Returns:

convertToInteger

RubyInteger convertToInteger()
Returns:

convertToInteger

@Deprecated
RubyInteger convertToInteger(int convertMethodIndex,
                                        java.lang.String convertMethod)
Deprecated. 

Returns:

convertToInteger

RubyInteger convertToInteger(java.lang.String convertMethod)
Returns:

convertToString

RubyString convertToString()
Returns:

anyToString

IRubyObject anyToString()
Returns:

checkStringType

IRubyObject checkStringType()
Returns:

checkArrayType

IRubyObject checkArrayType()
Returns:

dup

IRubyObject dup()
RubyMethod dup.

Returns:

inspect

IRubyObject inspect()
RubyMethod inspect.

Returns:
String

rbClone

IRubyObject rbClone()
RubyMethod rbClone.

Returns:
IRubyObject

isModule

boolean isModule()
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

boolean isClass()
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.

dataWrapStruct

void dataWrapStruct(java.lang.Object obj)
Our version of Data_Wrap_Struct. This method will just set a private pointer to the object provided. This pointer is transient and will not be accessible from Ruby.

Parameters:
obj - the object to wrap

dataGetStruct

java.lang.Object dataGetStruct()
Our version of Data_Get_Struct. Returns a wrapped data value if there is one, otherwise returns null.

Returns:
the object wrapped.

id

IRubyObject id()
Returns:

op_equal

IRubyObject op_equal(ThreadContext context,
                     IRubyObject other)

op_eqq

IRubyObject op_eqq(ThreadContext context,
                   IRubyObject other)

eql

boolean eql(IRubyObject other)

addFinalizer

void addFinalizer(IRubyObject finalizer)

removeFinalizers

void removeFinalizers()

hasVariables

boolean hasVariables()
Returns true if object has any variables, defined as:

Returns:
true if object has any variables, else false

getVariableCount

int getVariableCount()
Returns:
the count of all variables (ivar/cvar/constant/internal)

syncVariables

void syncVariables(java.util.List<Variable<IRubyObject>> variables)
Sets object's variables to those in the supplied list, removing/replacing any previously defined variables. Applies to all variable types (ivar/cvar/constant/internal).

Parameters:
variables - the variables to be set for object

getVariableList

java.util.List<Variable<IRubyObject>> getVariableList()
Returns:
a list of all variables (ivar/cvar/constant/internal)

getInstanceVariables

InstanceVariables getInstanceVariables()

getInternalVariables

InternalVariables getInternalVariables()

getVariableNameList

java.util.List<java.lang.String> getVariableNameList()
Returns:
a list of all variable names (ivar/cvar/constant/internal)

copySpecialInstanceVariables

void copySpecialInstanceVariables(IRubyObject clone)


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