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

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

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

Ruby.newBoolean介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@JRubyMethod(name = "==", required = 1)
@Override
public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
  if(!(other instanceof RubyModule)) return context.fals;
  RubyModule otherModule = (RubyModule) other;
  if(otherModule.isIncluded()) {
    return context.runtime.newBoolean(otherModule.isSame(this));
  } else {
    return context.runtime.newBoolean(isSame(otherModule));
  }
}

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

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

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

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

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

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

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

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

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

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

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

@JRubyMethod(name = "==", required = 1)
@Override
public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyTime) {
    return context.runtime.newBoolean(cmp((RubyTime) other) == 0);
  }
  if (other == context.nil) {
    return context.fals;
  }
  return RubyComparable.op_equal(context, this, other);
}

相关文章

Ruby类方法