E
- the type of the elementspublic final class EachSliceIterable<E> extends java.lang.Object implements java.lang.Iterable<RubyArray<E>>
EachSliceIterable
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 |
---|
EachSliceIterable(java.lang.Iterable<? extends E> iter,
int size)
Creates an
EachSliceIterable . |
public EachSliceIterable(java.lang.Iterable<? extends E> iter, int size)
EachSliceIterable
.iter
- an Iterablesize
- of the windowjava.lang.NullPointerException
- if iter is nulljava.lang.IllegalArgumentException
- if size is less than or equal to 0