public int compare(SearchNode object1, SearchNode object2)
    {
        float cost1 = object1.getPathCost();
        float cost2 = object2.getPathCost();

        return (cost1 > cost2) ? 1 : ((cost1 < cost2) ? -1 : 0);
    }
public int compare(SearchNode object1, SearchNode object2)
    {
        float cost1 = object1.getPathCost();
        float cost2 = object2.getPathCost();

        return (cost1 > cost2) ? 1 : ((cost1 < cost2) ? -1 : 0);
    }
public int compare ( SearchNode object1 , SearchNode object2 ) { float cost1 = object1 . getPathCost ( ) ; float cost2 = object2 . getPathCost ( ) ; return ( cost1 > cost2 ) ? 1 : ( ( cost1 < cost2 ) ? - 1 : 0 ) ; }
Compares two search nodes by their path cost.

@param  object1 The first search node to compare.
@param  object2 The second search node to compare.

@return 1 if the first node has a higher path cost than the second, -1 if it has a lower path cost and 0 if they
have the same path cost.
Compares two search nodes by their path cost .