1 33 package org.jruby.runtime.builtin; 34 35 import java.util.Iterator ; 36 import java.util.Map ; 37 38 import org.jruby.Ruby; 39 import org.jruby.RubyArray; 40 import org.jruby.RubyClass; 41 import org.jruby.RubyFloat; 42 import org.jruby.RubyInteger; 43 import org.jruby.RubyModule; 44 import org.jruby.RubyFixnum; 45 import org.jruby.RubyString; 46 import org.jruby.ast.Node; 47 import org.jruby.runtime.Block; 48 import org.jruby.runtime.CallType; 49 import org.jruby.runtime.ThreadContext; 50 import org.jruby.runtime.callback.Callback; 51 52 57 public interface IRubyObject { 58 public static final IRubyObject[] NULL_ARRAY = new IRubyObject[0]; 59 60 69 int getNativeTypeIndex(); 70 71 78 Map safeGetInstanceVariables(); 79 80 86 boolean safeHasInstanceVariables(); 87 88 93 IRubyObject getInstanceVariable(String string); 94 95 101 IRubyObject setInstanceVariable(String string, IRubyObject rubyObject); 102 103 Map getInstanceVariables(); 104 Map getInstanceVariablesSnapshot(); 105 106 IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, String name, IRubyObject[] args, CallType callType, Block block); 107 IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, byte switchvalue, String name, IRubyObject[] args, CallType callType); 108 109 IRubyObject callMethod(ThreadContext context, byte switchValue, String name, IRubyObject arg); 110 IRubyObject callMethod(ThreadContext context, byte switchValue, String name, IRubyObject[] args); 111 IRubyObject callMethod(ThreadContext context, byte switchValue, String name, IRubyObject[] args, CallType callType); 112 IRubyObject callMethod(ThreadContext context, byte switchValue, String name, IRubyObject[] args, CallType callType, Block block); 113 114 IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args, CallType callType); 115 IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args, CallType callType, Block block); 116 117 123 IRubyObject callMethod(ThreadContext context, String string); 124 IRubyObject callMethod(ThreadContext context, String string, Block aBlock); 125 126 133 IRubyObject callMethod(ThreadContext context, String string, IRubyObject arg); 134 135 142 IRubyObject callMethod(ThreadContext context, String method, IRubyObject[] rubyArgs); 143 IRubyObject callMethod(ThreadContext context, String method, IRubyObject[] rubyArgs, Block block); 144 145 149 boolean isNil(); 150 151 boolean isTrue(); 152 153 157 boolean isTaint(); 158 159 163 boolean isFrozen(); 164 165 boolean isImmediate(); 166 167 170 RubyClass getMetaClass(); 171 172 void setMetaClass(RubyClass metaClass); 173 174 178 RubyClass getSingletonClass(); 179 180 184 RubyClass getType(); 185 186 191 boolean isKindOf(RubyModule rubyClass); 192 193 198 boolean respondsTo(String string); 199 200 203 Ruby getRuntime(); 204 205 209 Class getJavaClass(); 210 211 216 IRubyObject eval(Node iNode); 217 218 227 IRubyObject evalWithBinding(ThreadContext context, IRubyObject evalString, IRubyObject binding, String file); 228 229 237 IRubyObject evalSimple(ThreadContext context, IRubyObject evalString, String file); 238 239 243 void extendObject(RubyModule rubyModule); 244 245 250 String asSymbol(); 251 252 255 RubyArray convertToArray(); 256 RubyFloat convertToFloat(); 257 RubyInteger convertToInteger(); 258 RubyString convertToString(); 259 260 262 RubyString objAsString(); 263 264 272 IRubyObject convertToType(String targetType, String convertMethod, boolean raiseOnError); 273 274 282 IRubyObject convertToTypeWithCheck(String targetType, String convertMethod); 283 284 285 289 void setTaint(boolean b); 290 291 294 void checkSafeString(); 295 296 302 IRubyObject convertType(Class type, String string, String string1); 303 304 307 IRubyObject dup(); 308 309 313 void initCopy(IRubyObject original); 314 315 319 void setFrozen(boolean b); 320 321 325 IRubyObject inspect(); 326 327 336 int checkArgumentCount(IRubyObject[] arguments, int minimum, int maximum); 337 338 342 IRubyObject rbClone(); 343 344 345 public void callInit(IRubyObject[] args, Block block); 346 347 352 void defineSingletonMethod(String name, Callback callback); 353 354 355 boolean isSingleton(); 356 Iterator instanceVariableNames(); 357 358 370 IRubyObject[] scanArgs(IRubyObject[] args, int required, int optional); 371 372 380 void dataWrapStruct(Object obj); 381 382 389 Object dataGetStruct(); 390 391 RubyFixnum id(); 392 393 IRubyObject anyToString(); 394 395 IRubyObject checkStringType(); 396 397 IRubyObject checkArrayType(); 398 399 IRubyObject equalInternal(final ThreadContext context, final IRubyObject other); 400 401 void attachToObjectSpace(); 402 403 IRubyObject send(IRubyObject[] args, Block block); 404 IRubyObject method(IRubyObject method); 405 } 406 | Popular Tags |