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

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

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

Ruby.getComparable介绍

暂无

代码示例

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

static RubyClass define(final Ruby runtime, final RubyClass proxy) {
  proxy.includeModule( runtime.getComparable() ); // include Comparable
  proxy.defineAnnotatedMethods(Class.class);
  return proxy;
}

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

static RubyModule define(final Ruby runtime, final RubyModule proxy) {
  proxy.includeModule( runtime.getComparable() ); // include Comparable
  proxy.defineAnnotatedMethods(Comparable.class);
  return proxy;
}

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

static RubyModule define(final Ruby runtime, final RubyModule proxy) {
  proxy.includeModule( runtime.getComparable() ); // include Comparable
  proxy.defineAnnotatedMethods(Comparable.class);
  return proxy;
}

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

static RubyClass define(final Ruby runtime, final RubyClass proxy) {
  proxy.includeModule( runtime.getComparable() ); // include Comparable
  proxy.defineAnnotatedMethods(Class.class);
  return proxy;
}

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

public static RubyClass createTimeClass(Ruby runtime) {
  RubyClass timeClass = runtime.defineClass("Time", runtime.getObject(), TIME_ALLOCATOR);
  timeClass.index = ClassIndex.TIME;
  timeClass.setReifiedClass(RubyTime.class);
  
  runtime.setTime(timeClass);
  
  timeClass.includeModule(runtime.getComparable());
  
  timeClass.defineAnnotatedMethods(RubyTime.class);
  
  return timeClass;
}

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

public static RubyClass createTimeClass(Ruby runtime) {
  RubyClass timeClass = runtime.defineClass("Time", runtime.getObject(), TIME_ALLOCATOR);
  timeClass.index = ClassIndex.TIME;
  timeClass.setReifiedClass(RubyTime.class);
  
  runtime.setTime(timeClass);
  
  timeClass.includeModule(runtime.getComparable());
  
  timeClass.defineAnnotatedMethods(RubyTime.class);
  
  return timeClass;
}

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

public static RubyClass createTimeClass(Ruby runtime) {
  RubyClass timeClass = runtime.defineClass("Time", runtime.getObject(), TIME_ALLOCATOR);
  timeClass.setClassIndex(ClassIndex.TIME);
  timeClass.setReifiedClass(RubyTime.class);
  runtime.setTime(timeClass);
  timeClass.includeModule(runtime.getComparable());
  timeClass.defineAnnotatedMethods(RubyTime.class);
  return timeClass;
}

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

public static RubyClass createNumericClass(Ruby runtime) {
  RubyClass numeric = runtime.defineClass("Numeric", runtime.getObject(), NUMERIC_ALLOCATOR);
  runtime.setNumeric(numeric);
  numeric.index = ClassIndex.NUMERIC;
  numeric.setReifiedClass(RubyNumeric.class);
  numeric.kindOf = new RubyModule.JavaClassKindOf(RubyNumeric.class);
  numeric.includeModule(runtime.getComparable());
  numeric.defineAnnotatedMethods(RubyNumeric.class);
  return numeric;
}

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

public static RubyClass createNumericClass(Ruby runtime) {
  RubyClass numeric = runtime.defineClass("Numeric", runtime.getObject(), NUMERIC_ALLOCATOR);
  runtime.setNumeric(numeric);
  numeric.index = ClassIndex.NUMERIC;
  numeric.setReifiedClass(RubyNumeric.class);
  numeric.kindOf = new RubyModule.JavaClassKindOf(RubyNumeric.class);
  numeric.includeModule(runtime.getComparable());
  numeric.defineAnnotatedMethods(RubyNumeric.class);
  return numeric;
}

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

public static RubyClass createTimeClass(Ruby runtime) {
  RubyClass timeClass = runtime.defineClass("Time", runtime.getObject(), TIME_ALLOCATOR);
  timeClass.setClassIndex(ClassIndex.TIME);
  timeClass.setReifiedClass(RubyTime.class);
  runtime.setTime(timeClass);
  timeClass.includeModule(runtime.getComparable());
  timeClass.defineAnnotatedMethods(RubyTime.class);
  return timeClass;
}

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

public static RubyClass createStringClass(Ruby runtime) {
  RubyClass stringClass = runtime.defineClass("String", runtime.getObject(), STRING_ALLOCATOR);
  runtime.setString(stringClass);
  stringClass.setClassIndex(ClassIndex.STRING);
  stringClass.setReifiedClass(RubyString.class);
  stringClass.kindOf = new RubyModule.JavaClassKindOf(RubyString.class);
  stringClass.includeModule(runtime.getComparable());
  stringClass.defineAnnotatedMethods(RubyString.class);
  return stringClass;
}

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

public static RubyClass createStringClass(Ruby runtime) {
  RubyClass stringClass = runtime.defineClass("String", runtime.getObject(), STRING_ALLOCATOR);
  runtime.setString(stringClass);
  stringClass.setClassIndex(ClassIndex.STRING);
  stringClass.setReifiedClass(RubyString.class);
  stringClass.kindOf = new RubyModule.JavaClassKindOf(RubyString.class);
  stringClass.includeModule(runtime.getComparable());
  stringClass.defineAnnotatedMethods(RubyString.class);
  return stringClass;
}

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

public static RubyClass createNumericClass(Ruby runtime) {
  RubyClass numeric = runtime.defineClass("Numeric", runtime.getObject(), NUMERIC_ALLOCATOR);
  runtime.setNumeric(numeric);
  numeric.setClassIndex(ClassIndex.NUMERIC);
  numeric.setReifiedClass(RubyNumeric.class);
  numeric.kindOf = new RubyModule.JavaClassKindOf(RubyNumeric.class);
  numeric.includeModule(runtime.getComparable());
  numeric.defineAnnotatedMethods(RubyNumeric.class);
  return numeric;
}

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

public static RubyClass createNumericClass(Ruby runtime) {
  RubyClass numeric = runtime.defineClass("Numeric", runtime.getObject(), NUMERIC_ALLOCATOR);
  runtime.setNumeric(numeric);
  numeric.setClassIndex(ClassIndex.NUMERIC);
  numeric.setReifiedClass(RubyNumeric.class);
  numeric.kindOf = new RubyModule.JavaClassKindOf(RubyNumeric.class);
  numeric.includeModule(runtime.getComparable());
  numeric.defineAnnotatedMethods(RubyNumeric.class);
  return numeric;
}

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

static RubyClass createDateClass(Ruby runtime) {
  RubyClass Date = runtime.defineClass("Date", runtime.getObject(), ALLOCATOR);
  Date.setReifiedClass(RubyDate.class);
  Date.includeModule(runtime.getComparable());
  Date.defineAnnotatedMethods(RubyDate.class);
  Date.setConstant("ITALY", runtime.newFixnum(ITALY));
  Date.setConstant("ENGLAND", runtime.newFixnum(ENGLAND));
  return Date;
}

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

static RubyClass createDateClass(Ruby runtime) {
  RubyClass Date = runtime.defineClass("Date", runtime.getObject(), ALLOCATOR);
  Date.setReifiedClass(RubyDate.class);
  Date.includeModule(runtime.getComparable());
  Date.defineAnnotatedMethods(RubyDate.class);
  Date.setConstant("ITALY", runtime.newFixnum(ITALY));
  Date.setConstant("ENGLAND", runtime.newFixnum(ENGLAND));
  return Date;
}

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

public static RubyClass createSymbolClass(Ruby runtime) {
  RubyClass symbolClass = runtime.defineClass("Symbol", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  runtime.setSymbol(symbolClass);
  RubyClass symbolMetaClass = symbolClass.getMetaClass();
  symbolClass.setClassIndex(ClassIndex.SYMBOL);
  symbolClass.setReifiedClass(RubySymbol.class);
  symbolClass.kindOf = new RubyModule.JavaClassKindOf(RubySymbol.class);
  symbolClass.defineAnnotatedMethods(RubySymbol.class);
  symbolMetaClass.undefineMethod("new");
  symbolClass.includeModule(runtime.getComparable());
  return symbolClass;
}

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

public static RubyClass createStringClass(Ruby runtime) {
  RubyClass stringClass = runtime.defineClass("String", runtime.getObject(), STRING_ALLOCATOR);
  runtime.setString(stringClass);
  stringClass.index = ClassIndex.STRING;
  stringClass.setReifiedClass(RubyString.class);
  stringClass.kindOf = new RubyModule.JavaClassKindOf(RubyString.class);
  stringClass.includeModule(runtime.getComparable());
  if (!runtime.is1_9()) stringClass.includeModule(runtime.getEnumerable());
  stringClass.defineAnnotatedMethods(RubyString.class);
  return stringClass;
}

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

public static RubyClass createSymbolClass(Ruby runtime) {
  RubyClass symbolClass = runtime.defineClass("Symbol", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
  runtime.setSymbol(symbolClass);
  RubyClass symbolMetaClass = symbolClass.getMetaClass();
  symbolClass.setClassIndex(ClassIndex.SYMBOL);
  symbolClass.setReifiedClass(RubySymbol.class);
  symbolClass.kindOf = new RubyModule.JavaClassKindOf(RubySymbol.class);
  symbolClass.defineAnnotatedMethods(RubySymbol.class);
  symbolMetaClass.undefineMethod("new");
  symbolClass.includeModule(runtime.getComparable());
  return symbolClass;
}

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

public static RubyClass createStringClass(Ruby runtime) {
  RubyClass stringClass = runtime.defineClass("String", runtime.getObject(), STRING_ALLOCATOR);
  runtime.setString(stringClass);
  stringClass.index = ClassIndex.STRING;
  stringClass.setReifiedClass(RubyString.class);
  stringClass.kindOf = new RubyModule.JavaClassKindOf(RubyString.class);
  stringClass.includeModule(runtime.getComparable());
  if (!runtime.is1_9()) stringClass.includeModule(runtime.getEnumerable());
  stringClass.defineAnnotatedMethods(RubyString.class);
  return stringClass;
}

相关文章

Ruby类方法