本文整理了Java中org.jruby.RubyHash.internalGet
方法的一些代码示例,展示了RubyHash.internalGet
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyHash.internalGet
方法的具体详情如下:
包路径:org.jruby.RubyHash
类名称:RubyHash
方法名:internalGet
暂无
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public boolean contains(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalGet((IRubyObject)o) != null;
}
public boolean remove(RubyHash hash, Object o) {
代码示例来源:origin: org.jruby/jruby-complete
@Override
public boolean contains(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalGet((IRubyObject)o) != null;
}
@Override
代码示例来源:origin: org.jruby/jruby-core
@Override
public boolean contains(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalGet((IRubyObject)o) != null;
}
@Override
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public boolean contains(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalGet((IRubyObject)o) != null;
}
public boolean remove(RubyHash hash, Object o) {
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_hash_aref
*
*/
@JRubyMethod(name = "[]", required = 1)
public IRubyObject op_aref(ThreadContext context, IRubyObject key) {
IRubyObject value;
return ((value = internalGet(key)) == null) ? invokedynamic(context, this, DEFAULT, key) : value;
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_hash_aref
*
*/
@JRubyMethod(name = "[]", required = 1)
public IRubyObject op_aref(ThreadContext context, IRubyObject key) {
IRubyObject value;
return ((value = internalGet(key)) == null) ? sites(context).default_.call(context, this, this, key) : value;
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
protected IRubyObject internalGet(IRubyObject key) {
if (size == 0) return null;
if (!isCaseSensitive()) {
key = getCorrectKey(key.convertToString());
}
return super.internalGet(key);
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public Object get(Object key) {
IRubyObject gotten = internalGet(JavaUtil.convertJavaToUsableRubyObject(getRuntime(), key));
return gotten == null ? null : gotten.toJava(Object.class);
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_hash_aref
*
*/
@JRubyMethod(name = "[]", required = 1)
public IRubyObject op_aref(ThreadContext context, IRubyObject key) {
IRubyObject value;
return ((value = internalGet(key)) == null) ? sites(context).default_.call(context, this, this, key) : value;
}
代码示例来源:origin: org.jruby/jruby-core
@Override
protected IRubyObject internalGet(IRubyObject key) {
if (size == 0) return null;
if (!isCaseSensitive()) {
key = getCorrectKey(key.convertToString());
}
return super.internalGet(key);
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_hash_slice
*
*/
@JRubyMethod(name = "slice", rest = true)
public RubyHash slice(final ThreadContext context, final IRubyObject[] args) {
RubyHash result = newHash(context.runtime);
for (int i = 0; i < args.length; i++) {
IRubyObject key = args[i];
IRubyObject value = this.internalGet(key);
if (value != null) result.op_aset(key, value);
}
return result;
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public void visit(ThreadContext context, RubyHash self, IRubyObject key, IRubyObject value, int index, Block block) {
if (block.isGiven()) {
IRubyObject existing = target.internalGet(key);
if (existing != null) {
value = block.yield(context, RubyArray.newArray(context.runtime, key, existing, value));
}
}
target.op_aset(context, key, value);
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void visit(IRubyObject key, IRubyObject value) {
if (block.isGiven()) {
IRubyObject existing = self.internalGet(key);
if (existing != null) {
value = block.yield(context, RubyArray.newArrayNoCopy(runtime, new IRubyObject[]{key, existing, value}));
}
}
self.op_aset(context, key, value);
}
});
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(compat = RUBY1_9)
public IRubyObject fetch(ThreadContext context, IRubyObject key, Block block) {
Ruby runtime = context.runtime;
IRubyObject value = internalGet(key);
if (value == null) {
if (block.isGiven()) return block.yield(context, key);
throw runtime.newKeyError("key not found: " + key);
}
return value;
}
代码示例来源:origin: org.jruby/jruby-core
@Override
public void visit(ThreadContext context, RubyHash self, IRubyObject key, IRubyObject value, int index, Block block) {
if (block.isGiven()) {
IRubyObject existing = target.internalGet(key);
if (existing != null) {
value = block.yield(context, RubyArray.newArray(context.runtime, key, existing, value));
}
}
target.op_aset(context, key, value);
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public void visit(IRubyObject key, IRubyObject value) {
if (block.isGiven()) {
IRubyObject existing = self.internalGet(key);
if (existing != null) {
value = block.yield(context, RubyArray.newArrayNoCopy(runtime, new IRubyObject[]{key, existing, value}));
}
}
self.op_aset(context, key, value);
}
});
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(compat = RUBY1_9)
public IRubyObject fetch(ThreadContext context, IRubyObject key, Block block) {
Ruby runtime = context.runtime;
IRubyObject value = internalGet(key);
if (value == null) {
if (block.isGiven()) return block.yield(context, key);
throw runtime.newKeyError("key not found: " + key);
}
return value;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void visit(IRubyObject key, IRubyObject value) {
if (block.isGiven()) {
IRubyObject existing = self.internalGet(key);
if (existing != null) {
value = block.yield(context, RubyArray.newArrayNoCopy(runtime, new IRubyObject[]{key, existing, value}));
}
}
self.op_aset(context, key, value);
}
});
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod
public IRubyObject fetch(ThreadContext context, IRubyObject key, Block block) {
Ruby runtime = context.runtime;
IRubyObject value = internalGet(key);
if (value == null) {
if (block.isGiven()) return block.yield(context, key);
throw runtime.newKeyError("key not found: " + key.inspect(), this, key);
}
return value;
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod
public IRubyObject fetch(ThreadContext context, IRubyObject key, Block block) {
Ruby runtime = context.runtime;
IRubyObject value = internalGet(key);
if (value == null) {
if (block.isGiven()) return block.yield(context, key);
throw runtime.newKeyError("key not found: " + key.inspect(), this, key);
}
return value;
}
内容来源于网络,如有侵权,请联系作者删除!