org.codehaus.plexus.util.dag

Class CycleDetector

public class CycleDetector extends Object

Version: $Id: CycleDetector.java 1106 2004-10-07 19:29:57Z jdcasey $

Author: Michal Maczka

Field Summary
static IntegerNOT_VISTITED
static IntegerVISITED
static IntegerVISITING
Method Summary
static booleandfsVisit(Vertex vertex, LinkedList cycle, Map vertexStateMap)
static ListhasCycle(DAG graph)
static ListintroducesCycle(Vertex vertex, Map vertexStateMap)
This method will be called when an egde leading to given vertex was added and we want to check if introduction of this edge has not resulted in apparition of cycle in the graph
static ListintroducesCycle(Vertex vertex)
static booleanisNotVisited(Vertex vertex, Map vertexStateMap)
static booleanisVisiting(Vertex vertex, Map vertexStateMap)

Field Detail

NOT_VISTITED

private static final Integer NOT_VISTITED

VISITED

private static final Integer VISITED

VISITING

private static final Integer VISITING

Method Detail

dfsVisit

private static boolean dfsVisit(Vertex vertex, LinkedList cycle, Map vertexStateMap)

hasCycle

public static List hasCycle(DAG graph)

introducesCycle

public static List introducesCycle(Vertex vertex, Map vertexStateMap)
This method will be called when an egde leading to given vertex was added and we want to check if introduction of this edge has not resulted in apparition of cycle in the graph

Parameters: vertex vertexStateMap

Returns:

introducesCycle

public static List introducesCycle(Vertex vertex)

isNotVisited

private static boolean isNotVisited(Vertex vertex, Map vertexStateMap)

Parameters: vertex vertexStateMap

Returns:

isVisiting

private static boolean isVisiting(Vertex vertex, Map vertexStateMap)

Parameters: vertex vertexStateMap

Returns: