    001package cpw.mods.fml.common.toposort;
    002
    003import java.util.Set;
    004
    005public class ModSortingException extends RuntimeException
    006{
    007    public class SortingExceptionData<T>
    008    {
    009        public SortingExceptionData(T node, Set<T> visitedNodes)
    010        {
    011            this.firstBadNode = node;
    012            this.visitedNodes = visitedNodes;
    013        }
    014
    015        private T firstBadNode;
    016        private Set<T> visitedNodes;
    017
    018        public T getFirstBadNode()
    019        {
    020            return firstBadNode;
    021        }
    022        public Set<T> getVisitedNodes()
    023        {
    024            return visitedNodes;
    025        }
    026    }
    027
    028    private SortingExceptionData sortingExceptionData;
    029
    030    public <T> ModSortingException(String string, T node, Set<T> visitedNodes)
    031    {
    032        super(string);
    033        this.sortingExceptionData = new SortingExceptionData(node, visitedNodes);
    034    }
    035
    036    public <T> SortingExceptionData<T> getExceptionData()
    037    {
    038        return sortingExceptionData;
    039    }
    040
    041}