package commons.graph.worker;

import commons.graph.model.EdgeInfo;

public class MaxDistanceFinder extends EdgeWorker
{

private int    edgeType = -1;
private double max      = 0;

public MaxDistanceFinder()
{}

public MaxDistanceFinder(int edgeType)
{
   this.edgeType = edgeType;
}

public void work (String a, String b)
{
   EdgeInfo E = edges.getInfo(a, b);
   if (edgeType == -1 || E.type == edgeType)
   {
      double d = edges.distance(a, b);
      max = max < d ? d : max;
   }
}

public double getMax ()
{
   return max;
}
}
