@Override public boolean equals(Object other) { if (this == other) return true; if (other instanceof RubyString) { if (((RubyString) other).value.equal(value)) return true; } return false; }
/** * Does this ByteList equal the other ByteList? * * @param other is the bytelist to compare with * @return true is this ByteList is the same */ @Override public boolean equals(Object other) { if (other instanceof ByteList) return equal((ByteList)other); return false; }
/** * Does this ByteList equal the other ByteList? * * @param other is the bytelist to compare with * @return true is this ByteList is the same */ @Override public boolean equals(Object other) { if (other instanceof ByteList) return equal((ByteList)other); return false; }
/** * Does this ByteList equal the other ByteList? * * @param other is the bytelist to compare with * @return true is this ByteList is the same */ @Override public boolean equals(Object other) { if (other instanceof ByteList) return equal((ByteList)other); return false; }
@Override public boolean equals(Object other) { if (this == other) return true; if (other instanceof RubyString) { RubyString string = (RubyString) other; if (string.value.equal(value)) return true; } return false; }
private boolean eql19(Ruby runtime, IRubyObject other) { RubyString otherString = (RubyString)other; return isComparableWith(otherString) && value.equal(((RubyString)other).value); }
private boolean eql19(Ruby runtime, IRubyObject other) { RubyString otherString = (RubyString)other; return isComparableWith(otherString) && value.equal(((RubyString)other).value); }
private boolean eql19(IRubyObject other) { final RubyString otherString = (RubyString) other; return StringSupport.areComparable(this, otherString) && value.equal(otherString.value); }
@JRubyMethod(name = "eql?", compat = RUBY1_8) public IRubyObject str_eql_p(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyString && value.equal(((RubyString)other).value)) return runtime.getTrue(); return runtime.getFalse(); }
@JRubyMethod(name = "eql?", compat = RUBY1_8) public IRubyObject str_eql_p(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyString && value.equal(((RubyString)other).value)) return runtime.getTrue(); return runtime.getFalse(); }
/** rb_str_equal * */ @JRubyMethod(name = {"==", "==="}) @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if (this == other) return context.tru; if (other instanceof RubyString) { RubyString otherString = (RubyString)other; return StringSupport.areComparable(this, otherString) && value.equal(otherString.value) ? context.tru : context.fals; } return op_equalCommon(context, other); }
@JRubyMethod(name = "eql?") public IRubyObject str_eql_p19(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyString) { RubyString otherString = (RubyString)other; if (StringSupport.areComparable(this, otherString) && value.equal(otherString.value)) return runtime.getTrue(); } return runtime.getFalse(); }
protected boolean strncmp(ByteList one, ByteList two, int length) { if (one.length() < length || two.length() < length) return false; return one.makeShared(0, length).equal(two.makeShared(0, length)); }
protected boolean strncmp(ByteList one, ByteList two, int length) { if (one.length() < length || two.length() < length) return false; return one.makeShared(0, length).equal(two.makeShared(0, length)); }
@JRubyMethod(name = "eql?") public IRubyObject str_eql_p19(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyString) { RubyString otherString = (RubyString)other; if (StringSupport.areComparable(this, otherString) && value.equal(otherString.value)) return runtime.getTrue(); } return runtime.getFalse(); }
@JRubyMethod(name = "eql?", compat = RUBY1_9) public IRubyObject str_eql_p19(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyString) { RubyString otherString = (RubyString)other; if (isComparableWith(otherString) && value.equal(otherString.value)) return runtime.getTrue(); } return runtime.getFalse(); }
@JRubyMethod(name = {"==", "eql?"}, required = 1) @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if (this == other) { return context.tru; } if (!(other instanceof RubyRegexp)) { return context.fals; } RubyRegexp otherRegex = (RubyRegexp) other; check(); otherRegex.check(); return context.runtime.newBoolean(str.equal(otherRegex.str) && options.equals(otherRegex.options)); }
@JRubyMethod(name = {"==", "eql?"}, required = 1) @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if (this == other) { return context.tru; } if (!(other instanceof RubyRegexp)) { return context.fals; } RubyRegexp otherRegex = (RubyRegexp) other; check(); otherRegex.check(); return context.runtime.newBoolean(str.equal(otherRegex.str) && options.equals(otherRegex.options)); }
@JRubyMethod(name = "eql?") public IRubyObject str_eql_p(ThreadContext context, IRubyObject other) { if (!(other instanceof RubyString)) return context.getRuntime().getFalse(); RubyString otherString = (RubyString)other; return value.equal(otherString.value) ? context.getRuntime().getTrue() : context.getRuntime().getFalse(); }
@JRubyMethod(name = {"==", "eql?"}, required = 1) @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if(this == other) return context.getRuntime().getTrue(); if(!(other instanceof RubyRegexp)) return context.getRuntime().getFalse(); RubyRegexp otherRegex = (RubyRegexp)other; check(); otherRegex.check(); return context.getRuntime().newBoolean(str.equal(otherRegex.str) && kcode == otherRegex.kcode && pattern.getOptions() == otherRegex.pattern.getOptions()); }