I am trying to construct a comparator for the priorityQueue that takes in returned from Weighter<? super Vlabel> class and Distancer<? super Vlabel>. 
Here is the code:
public static <VLabel, ELabel> List<Graph<VLabel, ELabel>.Edge> shortestPath(
            Graph<VLabel, ELabel> G,
            Graph<VLabel, ELabel>.Vertex V0,
            Graph<VLabel, ELabel>.Vertex V1,
            Distancer<? super VLabel> h, //heuristic value
            Weighter<? super VLabel> vweighter,
            Weighting<? super ELabel> eweighter) {
        Stack<Graph<VLabel, ELabel>.Vertex> closedSet
            = new Stack<Graph<VLabel, ELabel>.Vertex>();
        int initial = G.vertexSize();
        PriorityQueue<Graph<VLabel, ELabel>.Vertex> fringe
            = new PriorityQueue(initial, new Comparator<Graph<VLabel, ELabel>.Vertex>() {
                public int compare(Graph<VLabel, ELabel>.Vertex v0, Graph<VLabel, ELabel>.Vertex v1) {
                    double temp1 = vweighter.weight(v0.getLabel()) + h.dist(v0, V1);
                    double temp2 = vweighter.weight(v1.getLabel()) + h.dist(v1, V1);
                    return - (int) temp1.compareTo(temp2);
                } 
            });
    }
However it is not working because the code complains that it is unable to identify vweighter and h inside the compare method.
BTW, I am not allowed to set any parameters for shortestpath as final.
 
                        
Make the
vweighterandhparameters final:EDIT:
If you for some reason aren't allowed to use the final operator on the parameter variables you can redeclare them:
And then use the redeclared variables in the comparator.
UPDATE 2:
If you want to make a class that implements the comparable interface and you want to change the functions as you go, this is how you would make that class:
When instanciating it you should keep the reference and update the variables as needed.