@Override public synchronized boolean hasNext() { return ensureNexter(getRuntime()).hasNext(); }
@Override public synchronized boolean hasNext() { return ensureNexter(getRuntime()).hasNext(); }
@JRubyMethod(name = "dup") @Override public IRubyObject dup() { // JRUBY-5013: Enumerator needs to copy private fields in order to have a valid structure RubyEnumerator copy = (RubyEnumerator) super.dup(); copy.object = this.object; copy.method = this.method; copy.methodArgs = this.methodArgs; copy.size = this.size; copy.sizeFn = this.sizeFn; copy.feedValue = getRuntime().getNil(); return copy; }
@Override public Object next() { return next( getRuntime().getCurrentContext() ).toJava( java.lang.Object.class ); }
@JRubyMethod(name = "dup") @Override public IRubyObject dup() { // JRUBY-5013: Enumerator needs to copy private fields in order to have a valid structure RubyEnumerator copy = (RubyEnumerator) super.dup(); copy.object = this.object; copy.method = this.method; copy.methodArgs = this.methodArgs; copy.size = this.size; copy.sizeFn = this.sizeFn; copy.feedValue = getRuntime().getNil(); return copy; }
@Override public Object next() { return next( getRuntime().getCurrentContext() ).toJava( java.lang.Object.class ); }
@JRubyMethod public final IRubyObject size(ThreadContext context) { if (sizeFn != null) { return sizeFn.size(methodArgs); } IRubyObject size = this.size; if (size != null) { if (size.respondsTo("call")) { if (context == null) context = getRuntime().getCurrentContext(); return size.callMethod(context, "call"); } return size; } if (context == null) context = getRuntime().getCurrentContext(); return context.nil; }
@JRubyMethod public final IRubyObject size(ThreadContext context) { if (sizeFn != null) { return sizeFn.size(methodArgs); } IRubyObject size = this.size; if (size != null) { if (size.respondsTo("call")) { if (context == null) context = getRuntime().getCurrentContext(); return size.callMethod(context, "call"); } return size; } if (context == null) context = getRuntime().getCurrentContext(); return context.nil; }
private IRubyObject initialize20(IRubyObject object, IRubyObject method, IRubyObject[] methodArgs, IRubyObject size) { this.object = object; this.method = method.asJavaString(); this.methodArgs = methodArgs; this.size = size; setInstanceVariable("@__object__", object); setInstanceVariable("@__method__", method); setInstanceVariable("@__args__", RubyArray.newArrayNoCopyLight(getRuntime(), methodArgs)); return this; }
private IRubyObject initialize(IRubyObject object, IRubyObject method, IRubyObject[] methodArgs) { this.object = object; this.method = method.asJavaString(); this.methodArgs = methodArgs; setInstanceVariable("@__object__", object); setInstanceVariable("@__method__", method); setInstanceVariable("@__args__", RubyArray.newArrayNoCopyLight(getRuntime(), methodArgs)); return this; }
private IRubyObject initialize(IRubyObject object, IRubyObject method, IRubyObject[] methodArgs) { this.object = object; this.method = method.asJavaString(); this.methodArgs = methodArgs; setInstanceVariable("@__object__", object); setInstanceVariable("@__method__", method); setInstanceVariable("@__args__", RubyArray.newArrayNoCopyLight(getRuntime(), methodArgs)); return this; }
private IRubyObject initialize20(IRubyObject object, IRubyObject method, IRubyObject[] methodArgs, IRubyObject size) { this.object = object; this.method = method.asJavaString(); this.methodArgs = methodArgs; this.size = size; setInstanceVariable("@__object__", object); setInstanceVariable("@__method__", method); setInstanceVariable("@__args__", RubyArray.newArrayNoCopyLight(getRuntime(), methodArgs)); return this; }