public final class GraphtUtils
extends java.lang.Object
Helper utilities for Grapht integration.
Modifier and Type | Field and Description |
---|---|
static Ordering<DAGEdge<Component,Dependency>> |
DEP_EDGE_ORDER
An ordering over dependency edges.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkForPlaceholders(DAGNode<Component,Dependency> graph,
org.slf4j.Logger logger)
Check a graph for placeholder satisfactions.
|
static boolean |
desireIsTransient(Desire d)
Determine whether a desire is transient.
|
static boolean |
edgeIsTransient(DAGEdge<?,Dependency> input) |
static DAGNode<Component,Dependency> |
findSatisfyingNode(DAGNode<Component,Dependency> graph,
QualifierMatcher qmatch,
java.lang.Class<?> type)
Find a node with a satisfaction for a specified type.
|
static java.util.Set<DAGNode<Component,Dependency>> |
getPlaceholderNodes(DAGNode<Component,Dependency> graph)
Get the placeholder nodes from a graph.
|
static java.util.LinkedHashSet<DAGNode<Component,Dependency>> |
getShareableNodes(DAGNode<Component,Dependency> graph)
Find the set of shareable nodes (objects that will be replaced with instance satisfactions in the final graph).
|
static boolean |
isShareable(DAGNode<Component,Dependency> node)
Determine if a node is a shareable component.
|
public static final Ordering<DAGEdge<Component,Dependency>> DEP_EDGE_ORDER
An ordering over dependency edges.
public static void checkForPlaceholders(DAGNode<Component,Dependency> graph, org.slf4j.Logger logger) throws RecommenderConfigurationException
Check a graph for placeholder satisfactions.
graph
- The graph to check.RecommenderConfigurationException
- if the graph has a placeholder satisfaction.public static java.util.Set<DAGNode<Component,Dependency>> getPlaceholderNodes(DAGNode<Component,Dependency> graph)
Get the placeholder nodes from a graph.
graph
- The graph.public static boolean isShareable(DAGNode<Component,Dependency> node)
Determine if a node is a shareable component.
node
- The node.true
if the component is shareable.public static boolean desireIsTransient(@Nonnull Desire d)
Determine whether a desire is transient.
d
- The desire to test.true
if the desire is transient.public static boolean edgeIsTransient(DAGEdge<?,Dependency> input)
public static java.util.LinkedHashSet<DAGNode<Component,Dependency>> getShareableNodes(DAGNode<Component,Dependency> graph)
Find the set of shareable nodes (objects that will be replaced with instance satisfactions in the final graph).
graph
- The graph to analyze.@Nullable public static DAGNode<Component,Dependency> findSatisfyingNode(DAGNode<Component,Dependency> graph, QualifierMatcher qmatch, java.lang.Class<?> type)
Find a node with a satisfaction for a specified type. Does a breadth-first search to find the closest matching one.
type
- The type to look for.type
.