Package org.codehaus.plexus.util.dag

# Class CycleDetector

java.lang.Object
org.codehaus.plexus.util.dag.CycleDetector

public class CycleDetector extends Object

Author:
  Michal Maczka

## Constructor Summary

Constructors
Constructor
Description
`CycleDetector()`

## Method Summary

Modifier and Type
Method
Description
`static List<String>`
`hasCycle(DAG graph)`
`static List<String>`
`introducesCycle(Vertex vertex)`
`static List<String>`
`introducesCycle(Vertex vertex, Map<Vertex,Integer> vertexStateMap)`
This method will be called when an edge 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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CycleDetector

public CycleDetector()

## Method Details

### hasCycle

public static List<String> hasCycle(DAG graph)

### introducesCycle

public static List<String> introducesCycle(Vertex vertex, Map<Vertex,Integer> vertexStateMap)
This method will be called when an edge 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` - the vertex
  `vertexStateMap` - the vertex Map
Returns:
  the found cycle

### introducesCycle

public static List<String> introducesCycle(Vertex vertex)