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

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

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

Ruby.newTime介绍

暂无

代码示例

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = "atime")
  2. public IRubyObject atime() {
  3. return getRuntime().newTime(stat.atime() * 1000);
  4. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = "ctime")
  2. public IRubyObject ctime() {
  3. return getRuntime().newTime(stat.ctime() * 1000);
  4. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = "ctime")
  2. public IRubyObject ctime() {
  3. return getRuntime().newTime(stat.ctime() * 1000);
  4. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = "mtime")
  2. public IRubyObject mtime() {
  3. return getRuntime().newTime(stat.mtime() * 1000);
  4. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = "mtime")
  2. public IRubyObject mtime() {
  3. return getRuntime().newTime(stat.mtime() * 1000);
  4. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = "atime")
  2. public IRubyObject atime() {
  3. return getRuntime().newTime(stat.atime() * 1000);
  4. }

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

  1. @JRubyMethod(name = "birthtime")
  2. public IRubyObject birthtime(ThreadContext context) {
  3. checkClosed(context);
  4. FileTime btime = getBirthtimeWithNIO(getPath());
  5. if (btime != null) return context.runtime.newTime(btime.toMillis()); // btime comes in nanos
  6. return ctime(context);
  7. }

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

  1. @JRubyMethod(name = "birthtime")
  2. public IRubyObject birthtime(ThreadContext context) {
  3. checkClosed(context);
  4. FileTime btime = getBirthtimeWithNIO(getPath());
  5. if (btime != null) return context.runtime.newTime(btime.toMillis()); // btime comes in nanos
  6. return ctime(context);
  7. }

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

  1. @JRubyMethod(name = "birthtime")
  2. public IRubyObject birthtime() {
  3. checkInitialized();
  4. FileTime btime = null;
  5. if (file == null || (btime = RubyFile.getBirthtimeWithNIO(file.absolutePath())) == null) {
  6. return ctime();
  7. }
  8. return getRuntime().newTime(btime.toMillis());
  9. }

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

  1. @JRubyMethod(name = "birthtime")
  2. public IRubyObject birthtime() {
  3. checkInitialized();
  4. FileTime btime = null;
  5. if (file == null || (btime = RubyFile.getBirthtimeWithNIO(file.absolutePath())) == null) {
  6. return ctime();
  7. }
  8. return getRuntime().newTime(btime.toMillis());
  9. }

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

  1. @JRubyMethod(name = "atime")
  2. public IRubyObject atime() {
  3. checkInitialized();
  4. if (stat instanceof NanosecondFileStat) {
  5. return RubyTime.newTimeFromNanoseconds(getRuntime(), stat.atime() * BILLION + ((NanosecondFileStat) stat).aTimeNanoSecs());
  6. }
  7. return getRuntime().newTime(stat.atime() * 1000);
  8. }

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

  1. @JRubyMethod(name = "ctime")
  2. public IRubyObject ctime() {
  3. checkInitialized();
  4. if (stat instanceof NanosecondFileStat) {
  5. return RubyTime.newTimeFromNanoseconds(getRuntime(), stat.ctime() * BILLION + ((NanosecondFileStat) stat).cTimeNanoSecs());
  6. }
  7. return getRuntime().newTime(stat.ctime() * 1000);
  8. }

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

  1. @JRubyMethod(name = "mtime")
  2. public IRubyObject mtime() {
  3. checkInitialized();
  4. if (stat instanceof NanosecondFileStat) {
  5. return RubyTime.newTimeFromNanoseconds(getRuntime(), stat.mtime() * BILLION + ((NanosecondFileStat) stat).mTimeNanoSecs());
  6. }
  7. return getRuntime().newTime(stat.mtime() * 1000);
  8. }

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

  1. @JRubyMethod(name = "atime")
  2. public IRubyObject atime() {
  3. checkInitialized();
  4. if (stat instanceof NanosecondFileStat) {
  5. return RubyTime.newTimeFromNanoseconds(getRuntime(), stat.atime() * BILLION + ((NanosecondFileStat) stat).aTimeNanoSecs());
  6. }
  7. return getRuntime().newTime(stat.atime() * 1000);
  8. }

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

  1. @JRubyMethod(name = "ctime")
  2. public IRubyObject ctime() {
  3. checkInitialized();
  4. if (stat instanceof NanosecondFileStat) {
  5. return RubyTime.newTimeFromNanoseconds(getRuntime(), stat.ctime() * BILLION + ((NanosecondFileStat) stat).cTimeNanoSecs());
  6. }
  7. return getRuntime().newTime(stat.ctime() * 1000);
  8. }

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

  1. @JRubyMethod(name = "mtime")
  2. public IRubyObject mtime() {
  3. checkInitialized();
  4. if (stat instanceof NanosecondFileStat) {
  5. return RubyTime.newTimeFromNanoseconds(getRuntime(), stat.mtime() * BILLION + ((NanosecondFileStat) stat).mTimeNanoSecs());
  6. }
  7. return getRuntime().newTime(stat.mtime() * 1000);
  8. }

代码示例来源:origin: twineworks/ruby-for-pentaho-kettle

  1. rubyRow.put(field, data.runtime.newTime((vm.getDate(r[i])).getTime()));
  2. break;
  3. ValueMetaTimestamp vmTimestamp = (ValueMetaTimestamp) vm;
  4. Timestamp ts = vmTimestamp.getTimestamp(r[i]);
  5. RubyTime rubyTime = data.runtime.newTime(ts.getTime()/1000*1000);
  6. rubyTime.setNSec(ts.getNanos());
  7. rubyRow.put(field, rubyTime);

相关文章

Ruby类方法