public int indexX(int k){
  int i=Arrays.binarySearch(this.xIndex,k);
  if (i >= 0) {
    return i;
  }
 else {
    return -1 * i - 2;
  }
}

public int indexX ( int k ) { int i = Arrays . binarySearch ( this . xIndex , k ) ; if ( i >= 0 ) { return i ; } else { return - 1 * i - 2 ; } }
given index k , returns the column index containing k .
