protected RubyArray buildRubyArray(Class[] classes) { RubyArray result = getRuntime().newArray(classes.length); for (int i = 0; i < classes.length; i++) { result.append(JavaClass.get(getRuntime(), classes[i])); } return result; }
protected RubyArray buildRubyArray(Class[] classes) { RubyArray result = getRuntime().newArray(classes.length); for (int i = 0; i < classes.length; i++) { result.append(JavaClass.get(getRuntime(), classes[i])); } return result; }
@JRubyMethod(name = "equal?") public IRubyObject same(IRubyObject other) { if (!(other instanceof JavaObject)) { Object otherObj = other.dataGetStruct(); if (!(otherObj instanceof JavaObject)) { return getRuntime().getFalse(); } other = (IRubyObject)otherObj; } boolean isSame = this == other; return isSame ? getRuntime().getTrue() : getRuntime().getFalse(); }
@Deprecated public IRubyObject op_equal(IRubyObject other) { return op_eqq(getRuntime().getCurrentContext(), other); }
@JRubyMethod(name = "equal?") public IRubyObject same(IRubyObject other) { if (!(other instanceof JavaObject)) { Object otherObj = other.dataGetStruct(); if (!(otherObj instanceof JavaObject)) { return getRuntime().getFalse(); } other = (IRubyObject)otherObj; } boolean isSame = this == other; return isSame ? getRuntime().getTrue() : getRuntime().getFalse(); }
@Deprecated public IRubyObject same(IRubyObject other) { return op_equal(getRuntime().getCurrentContext(), other); }
protected RubyArray buildRubyArray(IRubyObject[] constructors) { RubyArray result = getRuntime().newArray(constructors.length); for (int i = 0; i < constructors.length; i++) { result.append(constructors[i]); } return result; }
@JRubyMethod(name = "[]") public IRubyObject aref(IRubyObject index) { throw getRuntime().newTypeError("not a java array"); }
protected RubyArray buildRubyArray(IRubyObject[] constructors) { RubyArray result = getRuntime().newArray(constructors.length); for (int i = 0; i < constructors.length; i++) { result.append(constructors[i]); } return result; }
@JRubyMethod(name = {"==", "eql?"}) public IRubyObject op_equal(IRubyObject other) { if (!(other instanceof JavaProxyReflectionObject)) { Object otherObj = other.dataGetStruct(); if (!(otherObj instanceof JavaObject)) { return getRuntime().getFalse(); } other = (IRubyObject)otherObj; } boolean isEqual = equals(other); return isEqual ? getRuntime().getTrue() : getRuntime().getFalse(); }
@JRubyMethod(name = {"==", "eql?"}) public IRubyObject op_equal(IRubyObject other) { if (!(other instanceof JavaProxyReflectionObject)) { Object otherObj = other.dataGetStruct(); if (!(otherObj instanceof JavaObject)) { return getRuntime().getFalse(); } other = (IRubyObject)otherObj; } boolean isEqual = equals(other); return isEqual ? getRuntime().getTrue() : getRuntime().getFalse(); }
@JRubyMethod(name = "java_proxy?") public IRubyObject is_java_proxy() { return getRuntime().getFalse(); }
@JRubyMethod public RubyFixnum length() { throw getRuntime().newTypeError("not a java array"); }
@JRubyMethod(name = "[]") public IRubyObject aref(IRubyObject index) { throw getRuntime().newTypeError("not a java array"); }
@JRubyMethod(name = "[]=") public IRubyObject aset(IRubyObject index, IRubyObject someValue) { throw getRuntime().newTypeError("not a java array"); }
@Override @JRubyMethod public IRubyObject to_s() { return getRuntime().newString(toString()); }
@Override @JRubyMethod public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }
@Override @JRubyMethod public IRubyObject to_s() { return getRuntime().newString(toString()); }
@JRubyMethod public JavaClass java_class() { return JavaClass.get(getRuntime(), getJavaClass()); }
@Override @JRubyMethod public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }