展开全部
package test;
import java.util.*;
public class GectorGraph {
private Point root;
private List> circlePath;
public GectorGraph(String pointName) {
root=new Point(pointName);
}
public GectorGraph(Point point) {
root=point;
}
public boolean hasCirclePath(){
findCirclePath();
return circlePath.size()>0;
}
public void findCirclePath(){
List CirclePoints=findCirclePoint();
if(circlePath==null){circlePath=new ArrayList>();}
for(Point tempPoint:CirclePoints){
List pointPath=new ArrayList();
findPointPath(tempPoint,root,pointPath);
pointPath.add(root.pointName);
circlePath.add(pointPath);
}
}
public boolean findPointPath(Point target,Point cu