i want to add objects to priority queue by using specified value like this
PriorityQueue<Edge> queue=new PriorityQueue<Edge>();
this is class Edge which i want to sort in priority queue by its weight
public class Edge {
private int start,end;
private double weight;
public Edge(int s, int e,Double w){
start=s;
end=e;
weight=w;
}
public int getStart(){
return start;
}
public int getEnd(){
return end;
}
public double getWeight(){
return weight;
}