|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aima.util.LabeledGraph<VertexLabelType,EdgeLabelType>
public class LabeledGraph<VertexLabelType,EdgeLabelType>
Represents a directed labeled graph. Vertices are represented by their unique
labels and labeled edges by means of nested hashtables. Variant of class
aima.util.Table
. This version is more dynamic, it requires no
initialization and can add new items whenever needed.
Constructor Summary | |
---|---|
LabeledGraph()
Creates a new empty graph. |
Method Summary | |
---|---|
void |
addVertex(VertexLabelType v)
Adds a new vertex to the graph if it is not already present. |
void |
clear()
Removes all vertices and all edges from the graph. |
EdgeLabelType |
get(VertexLabelType from,
VertexLabelType to)
Returns the label of the edge between the specified vertices and null if there is no edge between them. |
java.util.List<VertexLabelType> |
getSuccessors(VertexLabelType v)
Returns the labels of those vertices which can be obtained by following the edges starting at the specified vertex. |
java.util.List<VertexLabelType> |
getVertexLabels()
Returns the labels of all vertices within the graph. |
boolean |
isVertexLabel(VertexLabelType v)
Checks whether the given label is the label of one of the vertices. |
void |
remove(VertexLabelType from,
VertexLabelType to)
Removes an edge from the graph. |
void |
set(VertexLabelType from,
VertexLabelType to,
EdgeLabelType el)
Adds a directed labeled edge to the graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabeledGraph()
Method Detail |
---|
public void addVertex(VertexLabelType v)
public void set(VertexLabelType from, VertexLabelType to, EdgeLabelType el)
public void remove(VertexLabelType from, VertexLabelType to)
public EdgeLabelType get(VertexLabelType from, VertexLabelType to)
public java.util.List<VertexLabelType> getSuccessors(VertexLabelType v)
public java.util.List<VertexLabelType> getVertexLabels()
public boolean isVertexLabel(VertexLabelType v)
public void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |