本文整理了Java中org.jruby.RubyHash.internalDelete
方法的一些代码示例,展示了RubyHash.internalDelete
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyHash.internalDelete
方法的具体详情如下:
包路径:org.jruby.RubyHash
类名称:RubyHash
方法名:internalDelete
暂无
代码示例来源:origin: org.jruby/jruby-core
@Override
public boolean remove(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalDelete((IRubyObject)o) != NO_ENTRY;
}
};
代码示例来源:origin: org.jruby/jruby-complete
@Override
public boolean remove(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalDelete((IRubyObject)o) != NO_ENTRY;
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public boolean remove(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalDelete((IRubyObject)o) != NO_ENTRY;
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public boolean remove(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
return hash.internalDelete((IRubyObject)o) != NO_ENTRY;
}
};
代码示例来源:origin: org.jruby/jruby-complete
protected RubyHashEntry internalDelete(final IRubyObject key) {
if (size == 0) return NO_ENTRY;
return internalDelete(hashValue(key), MATCH_KEY, key);
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
protected RubyHashEntry internalDelete(final IRubyObject key) {
return internalDelete(hashValue(key.hashCode()), MATCH_KEY, key);
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public Object remove(Object key) {
IRubyObject rubyKey = JavaUtil.convertJavaToUsableRubyObject(getRuntime(), key);
return internalDelete(rubyKey).value;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public Object remove(Object key) {
IRubyObject rubyKey = JavaUtil.convertJavaToUsableRubyObject(getRuntime(), key);
return internalDelete(rubyKey).value;
}
代码示例来源:origin: org.jruby/jruby-core
@Override
public boolean remove(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
IRubyObject obj = (IRubyObject) o;
IRubyObject key = hash.internalIndex(obj.getRuntime().getCurrentContext(), obj);
if (key == null) return false;
return hash.internalDelete(key) != NO_ENTRY;
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public boolean remove(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
IRubyObject obj = (IRubyObject) o;
IRubyObject key = hash.internalIndex(obj.getRuntime().getCurrentContext(), obj);
if (key == null) return false;
return hash.internalDelete(key) != NO_ENTRY;
}
};
代码示例来源:origin: org.jruby/jruby-complete
@Override
public boolean remove(RubyHash hash, Object o) {
if (!(o instanceof IRubyObject)) return false;
IRubyObject obj = (IRubyObject) o;
IRubyObject key = hash.internalIndex(obj.getRuntime().getCurrentContext(), obj);
if (key == null) return false;
return hash.internalDelete(key) != NO_ENTRY;
}
};
代码示例来源:origin: org.jruby/jruby-core
@Override
public Object remove(Object key) {
IRubyObject rubyKey = JavaUtil.convertJavaToUsableRubyObject(getRuntime(), key);
return internalDelete(rubyKey).value;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public boolean remove(RubyHash hash, Object o) {
IRubyObject value = JavaUtil.convertJavaToUsableRubyObject(hash.getRuntime(), o);
IRubyObject key = hash.internalIndex(hash.getRuntime().getCurrentContext(), value);
if (key == null) return false;
return hash.internalDelete(key) != NO_ENTRY;
}
};
代码示例来源:origin: org.jruby/jruby-complete
/** rb_hash_delete
*
*/
@JRubyMethod
public IRubyObject delete(ThreadContext context, IRubyObject key, Block block) {
modify();
final RubyHashEntry entry = internalDelete(key);
if (entry != NO_ENTRY) return entry.value;
if (block.isGiven()) return block.yield(context, key);
return context.nil;
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public boolean remove(RubyHash hash, Object o) {
IRubyObject value = JavaUtil.convertJavaToUsableRubyObject(hash.getRuntime(), o);
IRubyObject key = hash.internalIndex(hash.getRuntime().getCurrentContext(), value);
if (key == null) return false;
return hash.internalDelete(key) != NO_ENTRY;
}
};
代码示例来源:origin: org.jruby/jruby-core
/** rb_hash_delete
*
*/
@JRubyMethod
public IRubyObject delete(ThreadContext context, IRubyObject key, Block block) {
modify();
final RubyHashEntry entry = internalDelete(key);
if (entry != NO_ENTRY) return entry.value;
if (block.isGiven()) return block.yield(context, key);
return context.nil;
}
代码示例来源:origin: org.jruby/jruby-core
@Override
public boolean remove(RubyHash hash, Object o) {
IRubyObject value = JavaUtil.convertJavaToUsableRubyObject(hash.getRuntime(), o);
IRubyObject key = hash.internalIndex(hash.getRuntime().getCurrentContext(), value);
if (key == null) return false;
return hash.internalDelete(key) != NO_ENTRY;
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public boolean remove(RubyHash hash, Object o) {
IRubyObject value = JavaUtil.convertJavaToUsableRubyObject(hash.getRuntime(), o);
IRubyObject key = hash.internalIndex(hash.getRuntime().getCurrentContext(), value);
if (key == null) return false;
return hash.internalDelete(key) != NO_ENTRY;
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_hash_delete
*
*/
@JRubyMethod
public IRubyObject delete(ThreadContext context, IRubyObject key, Block block) {
modify();
final RubyHashEntry entry = internalDelete(key);
if (entry != NO_ENTRY) return entry.value;
if (block.isGiven()) return block.yield(context, key);
return getRuntime().getNil();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_hash_delete
*
*/
@JRubyMethod
public IRubyObject delete(ThreadContext context, IRubyObject key, Block block) {
modify();
final RubyHashEntry entry = internalDelete(key);
if (entry != NO_ENTRY) return entry.value;
if (block.isGiven()) return block.yield(context, key);
return getRuntime().getNil();
}
内容来源于网络,如有侵权,请联系作者删除!