public boolean hasNext(int index){
  for (int p=0; p < mask.length; p++) {
    if (mask[p]) {
      if (index <= lastElementIndex[p]) {
        return true;
      }
    }
  }
  return false;
}

public boolean hasNext ( int index ) { for ( int p = 0 ; p < mask . length ; p ++ ) { if ( mask [ p ] ) { if ( index <= lastElementIndex [ p ] ) { return true ; } } } return false ; }
returns true if the last possible index stored in lastelementindex for all currently selected partitions is not yet reached . might be used to prune iterations ( especially useful for linear partitions ) .
