@JRubyMethod(name = "java_proxy?") public IRubyObject is_java_proxy() { return getRuntime().getTrue(); }
@JRubyMethod public RubyFixnum length() { throw getRuntime().newTypeError("not a java array"); }
@JRubyMethod public RubyFixnum length() { throw getRuntime().newTypeError("not a java array"); }
@JRubyMethod public RubyFixnum length() { throw getRuntime().newTypeError("not a java array"); }
@JRubyMethod public RubyString java_type() { return getRuntime().newString(getJavaClass().getName()); }
@JRubyMethod public RubyString java_type() { return getRuntime().newString(getJavaClass().getName()); }
@JRubyMethod @Override public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }
@JRubyMethod @Override public IRubyObject to_s() { return to_s(getRuntime(), dataGetStruct()); }
@JRubyMethod @Override public IRubyObject to_s() { return to_s(getRuntime(), dataGetStruct()); }
@JRubyMethod @Override public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }
@JRubyMethod @Override public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }
@JRubyMethod public JavaClass java_class() { return JavaClass.get(getRuntime(), getJavaClass()); }
@JRubyMethod(name = {"==", "eql?"}, required = 1) public IRubyObject op_equal(final IRubyObject other) { return equals(getRuntime(), getValue(), other); }
@JRubyMethod @Override public IRubyObject to_s() { return to_s(getRuntime(), dataGetStruct()); }
@JRubyMethod @Override public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }
@JRubyMethod @Override public IRubyObject to_s() { return to_s(getRuntime(), dataGetStruct()); }
@JRubyMethod(name = {"==", "eql?"}, required = 1) public IRubyObject op_equal(final IRubyObject other) { return equals(getRuntime(), getValue(), other); }
@JRubyMethod public JavaClass java_class() { return JavaClass.get(getRuntime(), getJavaClass()); }
@JRubyMethod(name = "equal?", required = 1) public IRubyObject same(final IRubyObject other) { final Ruby runtime = getRuntime(); final Object thisValue = getValue(); final Object otherValue = unwrapObject(other, NEVER); if ( otherValue == NEVER ) { // not a wrapped object return runtime.getFalse(); } if ( ! (other instanceof JavaObject) ) return runtime.getFalse(); return runtime.newBoolean(thisValue == otherValue); }
@JRubyMethod(name = "equal?", required = 1) public IRubyObject same(final IRubyObject other) { final Ruby runtime = getRuntime(); final Object thisValue = getValue(); final Object otherValue = unwrapObject(other, NEVER); if ( otherValue == NEVER ) { // not a wrapped object return runtime.getFalse(); } if ( ! (other instanceof JavaObject) ) return runtime.getFalse(); return runtime.newBoolean(thisValue == otherValue); }