Tabnine Logo
RubyBignum.getLongValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getLongValue
method
in
org.jruby.RubyBignum

Best Java code snippets using org.jruby.RubyBignum.getLongValue (Showing top 5 results out of 315)

origin: org.apache.pig/pig

/**
 * A type specific conversion routine.
 *
 * @param  rbObject object to convert
 * @return          analogous Pig type
 */
public static Long rubyToPig(RubyBignum rbObject) {
  return rbObject.getLongValue();
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = {"concat", "<<"}, compat = RUBY1_9)
public RubyString concat19(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyFixnum) {
    int c = RubyNumeric.num2int(other);
    if (c < 0) {
      throw runtime.newRangeError("negative string size (or size too big)");
    }
    return concatNumeric(runtime, c);
  } else if (other instanceof RubyBignum) {
    if (((RubyBignum) other).getBigIntegerValue().signum() < 0) {
      throw runtime.newRangeError("negative string size (or size too big)");
    }
    long c = ((RubyBignum) other).getLongValue();
    return concatNumeric(runtime, (int) c);
  }
  
  if (other instanceof RubySymbol) throw runtime.newTypeError("can't convert Symbol into String");
  return append19(other);
}
origin: org.jruby/jruby-complete

/** rb_str_concat
 *
 */
@JRubyMethod(name = "<<")
public RubyString concatSingle(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyFixnum) {
    long c = RubyNumeric.num2long(other);
    if (c < 0) {
      throw runtime.newRangeError(c + " out of char range");
    }
    return concatNumeric(runtime, (int)(c & 0xFFFFFFFF));
  } else if (other instanceof RubyBignum) {
    if (((RubyBignum) other).getBigIntegerValue().signum() < 0) {
      throw runtime.newRangeError("negative string size (or size too big)");
    }
    long c = ((RubyBignum) other).getLongValue();
    return concatNumeric(runtime, (int) c);
  }
  if (other instanceof RubySymbol) throw runtime.newTypeError("can't convert Symbol into String");
  return append19(other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = {"concat", "<<"}, compat = RUBY1_9)
public RubyString concat19(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyFixnum) {
    int c = RubyNumeric.num2int(other);
    if (c < 0) {
      throw runtime.newRangeError("negative string size (or size too big)");
    }
    return concatNumeric(runtime, c);
  } else if (other instanceof RubyBignum) {
    if (((RubyBignum) other).getBigIntegerValue().signum() < 0) {
      throw runtime.newRangeError("negative string size (or size too big)");
    }
    long c = ((RubyBignum) other).getLongValue();
    return concatNumeric(runtime, (int) c);
  }
  
  if (other instanceof RubySymbol) throw runtime.newTypeError("can't convert Symbol into String");
  return append19(other);
}
origin: org.jruby/jruby-core

/** rb_str_concat
 *
 */
@JRubyMethod(name = "<<")
public RubyString concatSingle(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyFixnum) {
    long c = RubyNumeric.num2long(other);
    if (c < 0) {
      throw runtime.newRangeError(c + " out of char range");
    }
    return concatNumeric(runtime, (int)(c & 0xFFFFFFFF));
  } else if (other instanceof RubyBignum) {
    if (((RubyBignum) other).getBigIntegerValue().signum() < 0) {
      throw runtime.newRangeError("negative string size (or size too big)");
    }
    long c = ((RubyBignum) other).getLongValue();
    return concatNumeric(runtime, (int) c);
  }
  if (other instanceof RubySymbol) throw runtime.newTypeError("can't convert Symbol into String");
  return append19(other);
}
org.jrubyRubyBignumgetLongValue

Popular methods of RubyBignum

  • newBignum
  • getValue
    Getter for property value.
  • <init>
  • addFloat
  • addOther
  • big2dbl
    rb_big2dbl
  • big2long
    rb_big2long
  • bignorm
    rb_big_norm
  • checkShiftDown
  • coerceBin
  • coerceCmp
  • compareTo
  • coerceCmp,
  • compareTo,
  • convertToDouble,
  • createBignumClass,
  • dbl_cmp,
  • divmod,
  • even_p,
  • fix2big,
  • getBigIntegerValue

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Table (org.hibernate.mapping)
    A relational table
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now