Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   ***** BEGIN LICENSE BLOCK *****
   * Version: CPL 1.0/GPL 2.0/LGPL 2.1
   *
   * The contents of this file are subject to the Common Public
   * License Version 1.0 (the "License"); you may not use this file
   * except in compliance with the License. You may obtain a copy of
   * the License at http://www.eclipse.org/legal/cpl-v10.html
   *
  * Software distributed under the License is distributed on an "AS
  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  * implied. See the License for the specific language governing
  * rights and limitations under the License.
  *
  * Copyright (C) 2002-2004 Anders Bengtsson <ndrsbngtssn@yahoo.se>
  * Copyright (C) 2002-2004 Jan Arne Petersen <jpetersen@uni-bonn.de>
  * Copyright (C) 2004 Thomas E Enebo <enebo@acm.org>
  * Copyright (C) 2004 Charles O Nutter <headius@headius.com>
  * Copyright (C) 2004 Stefan Matthias Aust <sma@3plus4.de>
  * Copyright (C) 2006 Ola Bini <ola.bini@ki.se>
  * Copyright (C) 2007 William N Dortch <bill.dortch@gmail.com>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either of the GNU General Public License Version 2 or later (the "GPL"),
  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the CPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the CPL, the GPL or the LGPL.
  ***** END LICENSE BLOCK *****/
 package org.jruby.runtime.builtin;
 
 import java.util.List;
 
 import org.jruby.Ruby;
Object is the parent class of all classes in Ruby. Its methods are therefore available to all objects unless explicitly overridden.
 
 public interface IRubyObject {
    
 
     public static final IRubyObject[] NULL_ARRAY = new IRubyObject[0];
 
     @Deprecated
     public IRubyObject callSuper(ThreadContext contextIRubyObject[] argsBlock block);
 
     public IRubyObject callMethod(ThreadContext contextString name);
     public IRubyObject callMethod(ThreadContext contextString nameIRubyObject arg);
     public IRubyObject callMethod(ThreadContext contextString nameIRubyObject[] args);
     public IRubyObject callMethod(ThreadContext contextString nameIRubyObject[] argsBlock block);
     @Deprecated
     public IRubyObject callMethod(ThreadContext contextint methodIndexString name);
     @Deprecated
     public IRubyObject callMethod(ThreadContext contextint methodIndexString nameIRubyObject arg);
 
     public IRubyObject checkCallMethod(ThreadContext contextString name);
    
    
RubyMethod isNil.

Returns:
boolean
 
     boolean isNil();
    
    

Returns:
 
     boolean isTrue();
    
    
RubyMethod isTaint.

Returns:
boolean
 
     boolean isTaint();
    
    
RubyMethod setTaint.

Parameters:
b
 
     void setTaint(boolean b);
    
    
Infect this object using the taint of another object

Parameters:
obj
Returns:
    IRubyObject infectBy(IRubyObject obj);
    
    
RubyMethod isFrozen.

Returns:
boolean
    boolean isFrozen();
    
    
RubyMethod setFrozen.

Parameters:
b
    void setFrozen(boolean b);

    
RubyMethod isUntrusted.

Returns:
boolean
    boolean isUntrusted();

    
RubyMethod setUntrusted.

Parameters:
b
    void setUntrusted(boolean b);
    
    

Returns:
    boolean isImmediate();
    
    
RubyMethod getRubyClass.

Returns:
    RubyClass getMetaClass();
    
    
RubyMethod getSingletonClass.

Returns:
RubyClass
    RubyClass getSingletonClass();
    
    
RubyMethod getType.

Returns:
RubyClass
    RubyClass getType();
    
    
RubyMethod respondsTo.

Parameters:
string
Returns:
boolean
    boolean respondsTo(String string);

    
RubyMethod respondsTo.

Parameters:
string
Returns:
boolean
    boolean respondsToMissing(String string);

    
RubyMethod respondsTo.

Parameters:
string
Returns:
boolean
    boolean respondsToMissing(String stringboolean priv);
    
    
RubyMethod getRuntime.

Returns:
    Ruby getRuntime();
    
    
RubyMethod getJavaClass.

Returns:
Class
    Class getJavaClass();
    
    
Convert the object into a symbol name if possible.

Returns:
String the symbol name
    String asJavaString();
    
    
rb_obj_as_string

Returns:
    RubyString asString();
    
    
Methods which perform to_xxx if the object has such a method

Returns:
    RubyArray convertToArray();
    

Returns:
    RubyHash convertToHash();    
    

Returns:
    
    RubyFloat convertToFloat();
    

Returns:
    RubyInteger convertToInteger();
    

Returns:
    @Deprecated
    RubyInteger convertToInteger(int convertMethodIndexString convertMethod);
    

Returns:
    RubyInteger convertToInteger(String convertMethod);
    

Returns:
    RubyString convertToString();
    
    

Returns:
    IRubyObject anyToString();
    
    

Returns:
    IRubyObject checkStringType();

    

Returns:
    IRubyObject checkStringType19();
    
    

Returns:
    IRubyObject checkArrayType();

    
Convert the object to the specified Java class, if possible.

Parameters:
cls The target type to which the object should be converted.
    Object toJava(Class cls);

    
RubyMethod dup.

Returns:
    IRubyObject dup();
    
    
RubyMethod inspect.

Returns:
String
    IRubyObject inspect();
    
    
RubyMethod rbClone.

Returns:
IRubyObject
    IRubyObject rbClone();

    

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

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.
    boolean isClass();
    
    
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
    void dataWrapStruct(Object obj);
    
    
Our version of Data_Get_Struct. Returns a wrapped data value if there is one, otherwise returns null.

Returns:
the object wrapped.
    Object dataGetStructChecked();
    
    

Returns:
    IRubyObject id();
    
    
    public IRubyObject op_equal(ThreadContext contextIRubyObject other);
    public IRubyObject op_eqq(ThreadContext contextIRubyObject other);
    public boolean eql(IRubyObject other);
    public void addFinalizer(IRubyObject finalizer);
    public void removeFinalizers();
    //
    // COMMON VARIABLE METHODS
    //

    
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

Returns:
true if object has any variables, else false
    boolean hasVariables();

    

Returns:
the count of all variables (ivar/cvar/constant/internal)
    int getVariableCount();
    
    
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
    @Deprecated
    void syncVariables(List<Variable<Object>> variables);

    
Sets object's variables to those in the supplied object, removing/replacing any previously defined variables of the same name. Applies to all variable types (ivar/cvar/constant/internal).

Parameters:
source the source object containing the variables to sync
    void syncVariables(IRubyObject source);
    
    

Returns:
a list of all variables (ivar/cvar/constant/internal)
    //
    // INSTANCE VARIABLE METHODS
    //
    
    //
    // INTERNAL VARIABLE METHODS
    //

Returns:
a list of all variable names (ivar/cvar/constant/internal)
    public Object getVariable(int index);
    public void setVariable(int indexObject value);
New to GrepCode? Check out our FAQ X