org.jruby
Class RubyEnumerator.SlicedBlockCallback

java.lang.Object
  extended byorg.jruby.RubyEnumerator.SlicedBlockCallback
All Implemented Interfaces:
BlockCallback
Enclosing class:
RubyEnumerator

public static class RubyEnumerator.SlicedBlockCallback
extends java.lang.Object
implements BlockCallback

Block callback for slicing the results of calling the client block


Field Summary
protected  Block clientBlock
           
protected  Ruby runtime
           
protected  RubyArray slice
           
protected  long sliceSize
           
 
Constructor Summary
RubyEnumerator.SlicedBlockCallback(Ruby runtime, Block clientBlock, long sliceSize)
           
 
Method Summary
 IRubyObject call(ThreadContext context, IRubyObject[] args, Block block)
           
 boolean hasLeftovers()
          Slice may be over but there weren't enough items to make the slice
 void yieldLeftovers(ThreadContext context)
          Pass slice dregs on to client blcok
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

slice

protected RubyArray slice

sliceSize

protected final long sliceSize

clientBlock

protected final Block clientBlock

runtime

protected final Ruby runtime
Constructor Detail

RubyEnumerator.SlicedBlockCallback

public RubyEnumerator.SlicedBlockCallback(Ruby runtime,
                                          Block clientBlock,
                                          long sliceSize)
Method Detail

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        Block block)
Specified by:
call in interface BlockCallback

hasLeftovers

public boolean hasLeftovers()
Slice may be over but there weren't enough items to make the slice


yieldLeftovers

public void yieldLeftovers(ThreadContext context)
Pass slice dregs on to client blcok



Copyright © 2002-2007 JRuby Team. All Rights Reserved.