org.jruby.RubyHash.containsKey()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中org.jruby.RubyHash.containsKey方法的一些代码示例,展示了RubyHash.containsKey的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyHash.containsKey方法的具体详情如下:
包路径:org.jruby.RubyHash
类名称:RubyHash
方法名:containsKey

RubyHash.containsKey介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-complete

@Override
public boolean contains(RubyHash hash, Object o) {
  return hash.containsKey(o);
}
@Override

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public boolean contains(RubyHash hash, Object o) {
  return hash.containsKey(o);
}
public boolean remove(RubyHash hash, Object o) {

代码示例来源:origin: org.jruby/jruby-core

@Override
public boolean contains(RubyHash hash, Object o) {
  return hash.containsKey(o);
}
@Override

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public boolean contains(RubyHash hash, Object o) {
  return hash.containsKey(o);
}
public boolean remove(RubyHash hash, Object o) {

代码示例来源:origin: asciidoctor/asciidoctorj

@Override
public boolean containsKey(Object key) {
  if (!(key instanceof String)) {
    return false;
  }
  return rubyHash.containsKey(convertJavaToRubyKey((String) key));
}

代码示例来源:origin: org.asciidoctor/asciidoctorj

@Override
public boolean containsKey(Object key) {
  if (!(key instanceof String)) {
    return false;
  }
  return rubyHash.containsKey(convertJavaToRubyKey((String) key));
}

代码示例来源:origin: asciidoctor/asciidoctorj

@Override
public boolean containsKey(Object key) {
  if (!(key instanceof String)) {
    return false;
  }
  RubySymbol symbol = rubyHash.getRuntime().getSymbolTable().getSymbol((String) key);
  return rubyHash.containsKey(symbol);
}

代码示例来源:origin: org.asciidoctor/asciidoctorj

@Override
public boolean containsKey(Object key) {
  if (!(key instanceof String)) {
    return false;
  }
  RubySymbol symbol = rubyHash.getRuntime().getSymbolTable().getSymbol((String) key);
  return rubyHash.containsKey(symbol);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Warn when using unsupported options.
 *
 * @param options
 */
private static void checkUnsupportedOptions(IRubyObject options, Set<String> unsupported, String error) {
  if (options == null || options.isNil() || !(options instanceof RubyHash)) return;
  RubyHash optsHash = (RubyHash)options;
  Ruby runtime = optsHash.getRuntime();
  for (String key : unsupported) {
    if (optsHash.containsKey(runtime.newSymbol(key))) {
      runtime.getWarnings().warn(error + ": " + key);
    }
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Warn when using unsupported options.
 *
 * @param options
 */
private static void checkUnsupportedOptions(IRubyObject options, Set<String> unsupported, String error) {
  if (options == null || options.isNil() || !(options instanceof RubyHash)) return;
  RubyHash optsHash = (RubyHash)options;
  Ruby runtime = optsHash.getRuntime();
  for (String key : unsupported) {
    if (optsHash.containsKey(runtime.newSymbol(key))) {
      runtime.getWarnings().warn(error + ": " + key);
    }
  }
}

代码示例来源:origin: aurorafeint/jruby-memcached

private RubyFixnum getTTL(ThreadContext context, IRubyObject[] args, int index) {
  Ruby ruby = context.getRuntime();
  if (args.length > index) {
    if (args[index] instanceof RubyFixnum) {
      return (RubyFixnum) args[index];
    } else if (args[index] instanceof RubyHash) {
      RubyHash options = (RubyHash) args[index];
      if (options.containsKey(ruby.newSymbol("ttl"))) {
        Long ttl = (Long) options.get(ruby.newSymbol("ttl"));
        return ruby.newFixnum(ttl);
      } else if (options.containsKey(ruby.newSymbol("expires_in"))) {
        Long expiresIn = (Long) options.get(ruby.newSymbol("expires_in"));
        return ruby.newFixnum(expiresIn);
      }
    }
  }
  return ruby.newFixnum(super.getDefaultTTL());
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

if (options.containsKey(runtime.newSymbol("mode"))) {
  ioOptions = parseIOOptions19(options.fastARef(runtime.newSymbol("mode")));
if (options.containsKey(runtime.newSymbol("binmode")) &&
    options.fastARef(runtime.newSymbol("binmode")).isTrue()) {
if (options.containsKey(runtime.newSymbol("binmode")) &&
    options.fastARef(runtime.newSymbol("binmode")).isTrue()) {
if (options.containsKey(runtime.newSymbol("textmode")) &&
    options.fastARef(runtime.newSymbol("textmode")).isTrue()) {
if (options.containsKey(runtime.newSymbol("open_args"))) {
  IRubyObject args = options.fastARef(runtime.newSymbol("open_args"));

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

if (options.containsKey(runtime.newSymbol("mode"))) {
  ioOptions = parseIOOptions19(options.fastARef(runtime.newSymbol("mode")));
if (options.containsKey(runtime.newSymbol("binmode")) &&
    options.fastARef(runtime.newSymbol("binmode")).isTrue()) {
if (options.containsKey(runtime.newSymbol("binmode")) &&
    options.fastARef(runtime.newSymbol("binmode")).isTrue()) {
if (options.containsKey(runtime.newSymbol("textmode")) &&
    options.fastARef(runtime.newSymbol("textmode")).isTrue()) {
if (options.containsKey(runtime.newSymbol("open_args"))) {
  IRubyObject args = options.fastARef(runtime.newSymbol("open_args"));

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

} else if (!options.containsKey(runtime.newSymbol("mode"))) {
  mode |= ModeFlags.WRONLY;
  file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

} else if (!options.containsKey(runtime.newSymbol("mode"))) {
  mode |= ModeFlags.WRONLY;
  file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

} else if (!options.containsKey(runtime.newSymbol("mode"))) {
  mode |= ModeFlags.WRONLY;
  file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

} else if (!options.containsKey(runtime.newSymbol("mode"))) {
  mode |= ModeFlags.WRONLY;
  file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);

相关文章

微信公众号

最新文章

更多

RubyHash类方法