E
- the type of the elementspublic final class EachSliceIterator<E> extends java.lang.Object implements java.util.Iterator<RubyArray<E>>
EachSliceIterator
iterates each element by a window of size n. It
returns a RubyArray which includes n consecutive elements within this window,
then it moves the position to the very next element behind the window and so
on.Constructor and Description |
---|
EachSliceIterator(java.util.Iterator<? extends E> iter,
int size)
Creates an
EachSliceIterator . |
public EachSliceIterator(java.util.Iterator<? extends E> iter, int size)
EachSliceIterator
.iter
- an Iterablesize
- of the windowjava.lang.NullPointerException
- if iter is nulljava.lang.IllegalArgumentException
- if size is less than or equal to 0