org.jruby.Ruby.newBoolean()方法的使用及代码示例

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

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

Ruby.newBoolean介绍

暂无

代码示例

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

  1. @JRubyMethod(name = "===", required = 1)
  2. @Override
  3. public IRubyObject op_eqq(ThreadContext context, IRubyObject other) {
  4. return context.runtime.newBoolean(this == other);
  5. }

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

  1. @JRubyMethod(module = true, visibility = PRIVATE)
  2. public static IRubyObject disable(ThreadContext context, IRubyObject recv) {
  3. Ruby runtime = context.runtime;
  4. emptyImplementationWarning(runtime, ID.GC_DISABLE_UNIMPLEMENTED, "GC.disable");
  5. boolean old = gcDisabled;
  6. gcDisabled = true;
  7. return runtime.newBoolean(old);
  8. }

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

  1. /** rb_ary_includes
  2. *
  3. */
  4. @JRubyMethod(name = "include?", required = 1)
  5. public RubyBoolean include_p(ThreadContext context, IRubyObject item) {
  6. return context.runtime.newBoolean(includes(context, item));
  7. }

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

  1. /** rb_ary_frozen_p
  2. *
  3. */
  4. @JRubyMethod(name = "frozen?")
  5. @Override
  6. public RubyBoolean frozen_p(ThreadContext context) {
  7. return context.runtime.newBoolean(isFrozen() || (flags & TMPLOCK_ARR_F) != 0);
  8. }

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

  1. @JRubyMethod(name = "stop?")
  2. public RubyBoolean stop_p() {
  3. // not valid for "dead" state
  4. return getRuntime().newBoolean(status.get() == Status.SLEEP || status.get() == Status.DEAD);
  5. }

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

  1. @Override
  2. @JRubyMethod(name = "==", required = 1)
  3. public IRubyObject op_equal(ThreadContext context, IRubyObject obj) {
  4. return context.runtime.newBoolean(this.equals(obj));
  5. }

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

  1. @JRubyMethod(name = "closed?")
  2. public IRubyObject closed_p(ThreadContext context) {
  3. initializedCheck();
  4. return context.runtime.newBoolean(closed);
  5. }

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

  1. @Override
  2. @JRubyMethod(name = "positive?")
  3. public IRubyObject isPositive(ThreadContext context) {
  4. return context.runtime.newBoolean(isPositive());
  5. }

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

  1. @JRubyMethod(name = "==", required = 1)
  2. @Override
  3. public IRubyObject op_equal(ThreadContext context, IRubyObject obj) {
  4. return context.runtime.newBoolean(this.equals(obj));
  5. }

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

  1. @JRubyMethod(name = "java_identifier_part?", meta = true)
  2. public static IRubyObject java_identifier_part_p(final ThreadContext context, final IRubyObject self,
  3. final IRubyObject num) {
  4. return context.runtime.newBoolean( java.lang.Character.isJavaIdentifierPart(int_char(num)) );
  5. }

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

  1. /**
  2. * Returns true if the set contains the given object.
  3. */
  4. @JRubyMethod(name = "include?", alias = { "member?", "===" })
  5. public RubyBoolean include_p(final ThreadContext context, IRubyObject obj) {
  6. return context.runtime.newBoolean( containsImpl(obj) );
  7. }

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

  1. /** nil_xor
  2. *
  3. */
  4. @JRubyMethod(name = "^", required = 1)
  5. public static RubyBoolean op_xor(ThreadContext context, IRubyObject recv, IRubyObject obj) {
  6. return context.runtime.newBoolean(obj.isTrue());
  7. }

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

  1. /** rb_hash_has_value
  2. *
  3. */
  4. @JRubyMethod(name = {"has_value?", "value?"}, required = 1)
  5. public RubyBoolean has_value_p(ThreadContext context, IRubyObject expected) {
  6. return context.runtime.newBoolean(hasValue(context, expected));
  7. }

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

  1. @JRubyMethod(name = "==", required = 1)
  2. @Override
  3. public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
  4. if(!(other instanceof RubyModule)) return context.fals;
  5. RubyModule otherModule = (RubyModule) other;
  6. if(otherModule.isIncluded()) {
  7. return context.runtime.newBoolean(otherModule.isSame(this));
  8. } else {
  9. return context.runtime.newBoolean(isSame(otherModule));
  10. }
  11. }

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

  1. @JRubyMethod(name = "ipv6_mc_nodelocal?")
  2. public IRubyObject ipv6_mc_nodelocal_p(ThreadContext context) {
  3. Inet6Address in6 = getInet6Address();
  4. return context.runtime.newBoolean(in6 != null && in6.isMCNodeLocal());
  5. }

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

  1. @JRubyMethod(name = "ipv6_mc_sitelocal?")
  2. public IRubyObject ipv6_mc_sitelocal_p(ThreadContext context) {
  3. Inet6Address in6 = getInet6Address();
  4. return context.runtime.newBoolean(in6 != null && in6.isMCSiteLocal());
  5. }

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

  1. @JRubyMethod(name = "unix?", module=true)
  2. public static IRubyObject unix_p(ThreadContext context, IRubyObject recv) {
  3. return context.runtime.newBoolean(Platform.getPlatform().isUnix());
  4. }
  5. @JRubyMethod(name = "bsd?", module=true)

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

  1. @JRubyMethod(name = "<", required = 1)
  2. public IRubyObject op_lt(ThreadContext context, IRubyObject other) {
  3. if (other instanceof RubyTime) {
  4. return context.runtime.newBoolean(cmp((RubyTime) other) < 0);
  5. }
  6. return RubyComparable.op_lt(context, this, other);
  7. }

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

  1. @JRubyMethod(name = "===", required = 1)
  2. @Override
  3. public IRubyObject op_eqq(ThreadContext context, IRubyObject other) {
  4. if (other instanceof RubyTime) {
  5. return context.runtime.newBoolean(RubyNumeric.fix2int(invokedynamic(context, this, OP_CMP, other)) == 0);
  6. }
  7. return context.fals;
  8. }

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

  1. @JRubyMethod(name = "==", required = 1)
  2. @Override
  3. public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
  4. if (other instanceof RubyTime) {
  5. return context.runtime.newBoolean(cmp((RubyTime) other) == 0);
  6. }
  7. if (other == context.nil) {
  8. return context.fals;
  9. }
  10. return RubyComparable.op_equal(context, this, other);
  11. }

相关文章

Ruby类方法