private void checkDistanceFunction ( SpatialPrimitiveDistanceFunction < ? super O > distanceFunction ) { if ( ! settings . distanceFunction . equals ( distanceFunction ) ) { throw new IllegalArgumentException ( "Parameter distanceFunction must be an instance of " + this . distanceQuery . getClass ( ) + ", but is " + distanceFunction . getClass ( ) ) ; } }
Throws an IllegalArgumentException if the specified distance function is not an instance of the distance function used by this index .