Package ai.libs.jaicore.graph
Class Graph<T>
- java.lang.Object
-
- ai.libs.jaicore.graph.Graph<T>
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
LabeledGraph
public class Graph<T> extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdge(T from, T to)
void
addGraph(Graph<T> g)
void
addItem(T item)
boolean
equals(java.lang.Object obj)
java.util.Set<Pair<T,T>>
getEdges()
java.util.Set<T>
getItems()
java.lang.String
getLineBasedStringRepresentation()
Creates a new line for each path in the graph where the prefix common to the previous line is omitted.java.lang.String
getLineBasedStringRepresentation(int offset)
java.util.Set<T>
getPredecessors(T item)
T
getRoot()
java.util.Collection<T>
getSinks()
java.util.Collection<T>
getSources()
java.util.Set<T>
getSuccessors(T item)
int
hashCode()
boolean
hasItem(T item)
boolean
isEmpty()
boolean
isGraphSane()
void
removeEdge(T from, T to)
void
removeItem(T item)
-
-
-
Method Detail
-
addItem
public void addItem(T item)
-
getItems
public java.util.Set<T> getItems()
-
hasItem
public boolean hasItem(T item)
-
removeItem
public void removeItem(T item)
-
getSources
public final java.util.Collection<T> getSources()
-
getRoot
public final T getRoot()
-
getSinks
public final java.util.Collection<T> getSinks()
-
isEmpty
public boolean isEmpty()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getLineBasedStringRepresentation
public java.lang.String getLineBasedStringRepresentation()
Creates a new line for each path in the graph where the prefix common to the previous line is omitted. The order is obtained by BFS.
-
getLineBasedStringRepresentation
public java.lang.String getLineBasedStringRepresentation(int offset)
-
isGraphSane
public boolean isGraphSane()
-
-