Package ai.libs.jaicore.graph
Class Graph<T>
- java.lang.Object
-
- ai.libs.jaicore.graph.Graph<T>
-
- Direct Known Subclasses:
LabeledGraph
public class Graph<T> extends java.lang.Object
-
-
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)
void
addPath(java.util.List<T> path)
boolean
equals(java.lang.Object obj)
java.util.Set<T>
getConnected(T item)
java.util.Set<T>
getDescendants(T item)
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.Set<T>
getSiblings(T item)
java.util.Collection<T>
getSinks()
java.util.Collection<T>
getSources()
java.util.Set<T>
getSuccessors(T item)
boolean
hasEdge(T from, T to)
int
hashCode()
boolean
hasItem(T item)
boolean
hasPath(java.util.List<T> nodes)
boolean
isEmpty()
boolean
isGraphSane()
boolean
isUseBackPointers()
boolean
isUseForwardPointers()
void
removeEdge(T from, T to)
void
removeItem(T item)
void
setUseBackPointers(boolean useBackPointers)
void
setUseForwardPointers(boolean useForwardPointers)
-
-
-
Method Detail
-
addItem
public void addItem(T item)
-
addPath
public void addPath(java.util.List<T> path)
-
getItems
public java.util.Set<T> getItems()
-
hasItem
public boolean hasItem(T item)
-
hasPath
public boolean hasPath(java.util.List<T> nodes)
-
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()
-
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.
-
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(int offset)
-
isGraphSane
public boolean isGraphSane()
-
isUseBackPointers
public boolean isUseBackPointers()
-
setUseBackPointers
public void setUseBackPointers(boolean useBackPointers)
-
isUseForwardPointers
public boolean isUseForwardPointers()
-
setUseForwardPointers
public void setUseForwardPointers(boolean useForwardPointers)
-
-