DirectedGraph
public class DirectedGraph
extends Object
java.lang.オブジェクト | |
↳ | com.android.tradefed.util.DirectedGraph<V> |
A directed unweighted graphs implementation. The vertex type can be specified.
まとめ
パブリックコンストラクター | |
---|---|
DirectedGraph () |
パブリックメソッド | |
---|---|
void | addEdge (V from, V to) Add an edge to the graph; if either vertex does not exist, it's added. |
void | addVertice (V vertex) Add a vertex to the graph. |
boolean | contains (V vertex) True if graph contains vertex. |
boolean | isDag () True if graph is a dag (directed acyclic graph). |
void | removeEdge (V from, V to) Remove an edge from the graph. |
String | toString () String representation of graph. |
パブリックコンストラクター
DirectedGraph
public DirectedGraph ()
パブリックメソッド
addEdge
public void addEdge (V from, V to)
Add an edge to the graph; if either vertex does not exist, it's added.この実装により、マルチエッジと自己ループの作成が可能になります。
パラメーター | |
---|---|
from | V |
to | V |
addVertice
public void addVertice (V vertex)
Add a vertex to the graph. Inop if vertex is already in graph.
パラメーター | |
---|---|
vertex | V |
含まれています
public boolean contains (V vertex)
True if graph contains vertex.それ以外の場合は false。
パラメーター | |
---|---|
vertex | V |
戻り値 | |
---|---|
boolean |
isDag
public boolean isDag ()
True if graph is a dag (directed acyclic graph).
戻り値 | |
---|---|
boolean |
removeEdge
public void removeEdge (V from, V to)
Remove an edge from the graph.
パラメーター | |
---|---|
from | V |
to | V |
投げる | |
---|---|
IllegalArgumentException | if either vertex doesn't exist. |
toString
public String toString ()
String representation of graph.
戻り値 | |
---|---|
String |