protected void addToQueue ( double closestDistanceSq , KdTree . Node node , P target ) { if ( ! node . isLeaf ( ) ) { Helper h ; if ( unused . isEmpty ( ) ) { h = new Helper ( ) ; } else { h = unused . remove ( unused . size ( ) - 1 ) ; } h . closestPossibleSq = closestDistanceSq ; h . node = node ; queue . add ( h ) ; } else { checkBestDistance ( node , target ) ; } }
Adds a node to the priority queue .