All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xguzm.pathfinding.Util Maven / Gradle / Ivy

There is a newer version: 0.2.6
Show newest version
package org.xguzm.pathfinding;

import java.util.ArrayList;
import java.util.List;

public class Util {

	private static final List path = new ArrayList(); 
	
	@SuppressWarnings("unchecked")
	public static  List backtrace(T node){
		path.clear();
		path.add(node);
		T node1 = node;
		while (node1.getParent() != null){
			node1 = (T)node1.getParent();
			path.add(0, node1);
		}
		path.remove(0);
		return (List)path;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy