public boolean hasNext ( int windowSize , int increment ) { if ( windowSize <= 0 ) { throw new IllegalArgumentException ( "Window size must be positive." ) ; } try { if ( increment > 0 ) { return windowSize == mBounds . suffix ( mPosition ) . prefix ( windowSize ) . length ( ) ; } else { if ( mPosition == 0 ) { return windowSize == mBounds . suffix ( - windowSize ) . length ( ) ; } else { return windowSize == mBounds . prefix ( mPosition ) . suffix ( - windowSize ) . length ( ) ; } } } catch ( Exception e ) { return false ; } }
Check if next window of specified size is available .