private int findSingleHit(ArrayDouble.D2 boundsForRun, double target) {
    int hits = 0;
    int idxFound = -1;
    int n = boundsForRun.getShape()[0];
    for (int i = 0; i < n; i++) {
      if (contains(target, boundsForRun.get(i,0), boundsForRun.get(i,1))) {
        hits++;
        idxFound = i;
      }
    }
    if (hits == 1) return idxFound;
    if (hits == 0) return -1;
    return -hits;
  }
private int findSingleHit ( ArrayDouble . D2 boundsForRun , double target ) { int hits = 0 ; int idxFound = - 1 ; int n = boundsForRun . getShape ( ) [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( contains ( target , boundsForRun . get ( i , 0 ) , boundsForRun . get ( i , 1 ) ) ) { hits ++ ; idxFound = i ; } } if ( hits == 1 ) return idxFound ; if ( hits == 0 ) return - 1 ; return - hits ; }
return index if only one match, if no matches return -1, if > 1 match return -nhits