public static SpecialEncoding valueOf(ByteList name) { if (name.caseInsensitiveCmp(LOCALE_BL) == 0) { return LOCALE; } else if (name.caseInsensitiveCmp(EXTERNAL_BL) == 0) { return EXTERNAL; } else if (name.caseInsensitiveCmp(INTERNAL_BL) == 0) { return INTERNAL; } else if (name.caseInsensitiveCmp(FILESYSTEM_BL) == 0) { return FILESYSTEM; } return null; }
public static SpecialEncoding valueOf(ByteList name) { if (name.caseInsensitiveCmp(LOCALE_BL) == 0) { return LOCALE; } else if (name.caseInsensitiveCmp(EXTERNAL_BL) == 0) { return EXTERNAL; } else if (name.caseInsensitiveCmp(INTERNAL_BL) == 0) { return INTERNAL; } else if (name.caseInsensitiveCmp(FILESYSTEM_BL) == 0) { return FILESYSTEM; } return null; }
public static SpecialEncoding valueOf(ByteList name) { if (name.caseInsensitiveCmp(LOCALE_BL) == 0) { return LOCALE; } else if (name.caseInsensitiveCmp(EXTERNAL_BL) == 0) { return EXTERNAL; } else if (name.caseInsensitiveCmp(INTERNAL_BL) == 0) { return INTERNAL; } else if (name.caseInsensitiveCmp(FILESYSTEM_BL) == 0) { return FILESYSTEM; } return null; }
public static SpecialEncoding valueOf(ByteList name) { if (name.caseInsensitiveCmp(LOCALE_BL) == 0) { return LOCALE; } else if (name.caseInsensitiveCmp(EXTERNAL_BL) == 0) { return EXTERNAL; } else if (name.caseInsensitiveCmp(INTERNAL_BL) == 0) { return INTERNAL; } else if (name.caseInsensitiveCmp(FILESYSTEM_BL) == 0) { return FILESYSTEM; } return null; }
protected int asTruth(String name, ByteList value) { int result = value.caseInsensitiveCmp(TRUE); if (result == 0) return 1; result = value.caseInsensitiveCmp(FALSE); if (result == 0) return 0; warnings.warn(ID.ACCESSOR_MODULE_FUNCTION, "invalid value for " + name + ": " + value); return -1; }
protected int asTruth(String name, ByteList value) { int result = value.caseInsensitiveCmp(TRUE); if (result == 0) return 1; result = value.caseInsensitiveCmp(FALSE); if (result == 0) return 0; warnings.warn(ID.ACCESSOR_MODULE_FUNCTION, "invalid value for " + name + ": " + value); return -1; }
private static int day_num(RubyString s) { ByteList sb = s.getByteList(); int i; for (i=0; i<ABBR_DAYS.length; i++) { if (sb.caseInsensitiveCmp(ABBR_DAYS[i]) == 0) return i; } return -1; }
private static int day_num(RubyString s) { ByteList sb = s.getByteList(); int i; for (i=0; i<ABBR_DAYS.length; i++) { if (sb.caseInsensitiveCmp(ABBR_DAYS[i]) == 0) return i; } return -1; }
private static int mon_num(RubyString s) { ByteList sb = s.getByteList(); int i; for (i=0; i<ABBR_MONTHS.length; i++) { if (sb.caseInsensitiveCmp(ABBR_MONTHS[i]) == 0) return i + 1; } return -1; }
private static int mon_num(RubyString s) { ByteList sb = s.getByteList(); int i; for (i=0; i<ABBR_MONTHS.length; i++) { if (sb.caseInsensitiveCmp(ABBR_MONTHS[i]) == 0) return i + 1; } return -1; }
@JRubyMethod(compat = RUBY1_8) public IRubyObject casecmp(ThreadContext context, IRubyObject other) { return RubyFixnum.newFixnum(context.runtime, value.caseInsensitiveCmp(other.convertToString().value)); }
@JRubyMethod(compat = RUBY1_8) public IRubyObject casecmp(ThreadContext context, IRubyObject other) { return RubyFixnum.newFixnum(context.runtime, value.caseInsensitiveCmp(other.convertToString().value)); }
@JRubyMethod public IRubyObject casecmp(IRubyObject other) { int compare = value.caseInsensitiveCmp(stringValue(other).value); return RubyFixnum.newFixnum(getRuntime(), compare); }
continue; if (lexb.makeShared(str - 6, 6).caseInsensitiveCmp(CODING) == 0) break;
continue; if (lexb.makeShared(str - 6, 6).caseInsensitiveCmp(CODING) == 0) break;
@JRubyMethod(name = "casecmp", compat = RUBY1_9) public IRubyObject casecmp19(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; RubyString otherStr = other.convertToString(); Encoding enc = isCompatibleWith(otherStr); if (enc == null) return runtime.getNil(); if (singleByteOptimizable() && otherStr.singleByteOptimizable()) { return RubyFixnum.newFixnum(runtime, value.caseInsensitiveCmp(otherStr.value)); } else { return multiByteCasecmp(runtime, enc, value, otherStr.value); } }
@JRubyMethod(name = "casecmp", compat = RUBY1_9) public IRubyObject casecmp19(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; RubyString otherStr = other.convertToString(); Encoding enc = isCompatibleWith(otherStr); if (enc == null) return runtime.getNil(); if (singleByteOptimizable() && otherStr.singleByteOptimizable()) { return RubyFixnum.newFixnum(runtime, value.caseInsensitiveCmp(otherStr.value)); } else { return multiByteCasecmp(runtime, enc, value, otherStr.value); } }
@JRubyMethod(name = "casecmp") public IRubyObject casecmp(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; IRubyObject tmp = other.checkStringType(); if (tmp.isNil()) return runtime.getNil(); RubyString otherStr = (RubyString) tmp; Encoding enc = StringSupport.areCompatible(this, otherStr); if (enc == null) return context.nil; if (singleByteOptimizable() && otherStr.singleByteOptimizable()) { return RubyFixnum.newFixnum(runtime, value.caseInsensitiveCmp(otherStr.value)); } final int ret = StringSupport.multiByteCasecmp(enc, value, otherStr.value); if (ret < 0) return RubyFixnum.minus_one(runtime); if (ret > 0) return RubyFixnum.one(runtime); return RubyFixnum.zero(runtime); }
@JRubyMethod(name = "casecmp") public IRubyObject casecmp(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; IRubyObject tmp = other.checkStringType(); if (tmp.isNil()) return runtime.getNil(); RubyString otherStr = (RubyString) tmp; Encoding enc = StringSupport.areCompatible(this, otherStr); if (enc == null) return context.nil; if (singleByteOptimizable() && otherStr.singleByteOptimizable()) { return RubyFixnum.newFixnum(runtime, value.caseInsensitiveCmp(otherStr.value)); } final int ret = StringSupport.multiByteCasecmp(enc, value, otherStr.value); if (ret < 0) return RubyFixnum.minus_one(runtime); if (ret > 0) return RubyFixnum.one(runtime); return RubyFixnum.zero(runtime); }