code: private int compare(int i) {
  
          if (sortOnValues) {
              if (targetSearchValue > values[i]) {
                  return 1;
              } else if (targetSearchValue < values[i]) {
                  return -1;
              }
          } else {
              if (targetSearchValue > keys[i]) {
                  return 1;
              } else if (targetSearchValue < keys[i]) {
                  return -1;
              }
          }
  
          return 0;
      }
docs: Check if targeted column value in the row indexed i is less than the
  search target object.
  @param i the index
  @return -1, 0 or +1