code: protected boolean inc(Integer[] locations, int[] max) {
      boolean	result;
      int	i;
  
      result = true;
  
      i = 0;
      while (i < locations.length) {
        if (locations[i] < max[i] - 1) {
          locations[i]++;
          break;
        }
        else {
          locations[i] = 0;
          i++;
          // adding was not possible!
          if (i == locations.length)
            result = false;
        }
      }
  
      return result;
    }
docs: Increments the location array by 1.
  
  @param locations		the position in the space
  @param max		the maxima
  @return			true if locations could be incremented