public class GraphUtils extends Object
uk.ac.ebi.arrayexpress2.magetab.datamodel.graph.  The utility methods in this class are only guaranteed to work
 correctly on completely constructed graphs.uk.ac.ebi.arrayexpress2.magetab.datamodel.graph, 
SDRF, 
ADF| Constructor and Description | 
|---|
GraphUtils()  | 
| Modifier and Type | Method and Description | 
|---|---|
static <T extends Node>  | 
findDownstreamNodes(Node currentNode,
                   Class<T> downstreamNodeType)
Finds nodes downstream of the given node in the graph, searching for nodes of a particular type. 
 | 
static Collection<? extends Node> | 
findDownstreamNodes(Node currentNode,
                   String downstreamNodeType)
Finds nodes downstream of the given node in the graph, searching for nodes of a particular type. 
 | 
static <T extends Node>  | 
findUpstreamNodes(Node currentNode,
                 Class<T> upstreamNodeType)
Finds nodes upstream of the given node in the graph, searching for nodes of a particular type. 
 | 
static Collection<? extends Node> | 
findUpstreamNodes(Node currentNode,
                 String upstreamNodeType)
Finds nodes upstream of the given node in the graph, searching for nodes of a particular type. 
 | 
static boolean | 
isDirectlyDownstream(Node currentNode,
                    Node maybeDownstreamNode)
Determine whether the query node, "maybeDownstreamNode", is downstream of the current node in the given SDRF
 graph. 
 | 
static boolean | 
isDirectlyUpstream(Node currentNode,
                  Node maybeUpstreamNode)
Determine whether the query node, "maybeUpstreamNode", is upstream of the current node in the given graph. 
 | 
public static <T extends Node> Collection<T> findUpstreamNodes(Node currentNode, Class<T> upstreamNodeType)
     a -> b1 -> b2 -> c
 
 If you call findUpstreamNodes(sdrf, c, B.class); your answer will contain b1 and b2.
 
 Note that this method will return a snapshot of the nodes currently upstream of the queried node if this method
 is called whilst the graph is being constructed.  Even if you wish to do this, often results will be correct,
 except where pooling occurs upstream of the queried node from a node that has not yet been read.currentNode - the current node - this method will locate all nodes upstream of this nodeupstreamNodeType - the type of nodes you are interested in locatingpublic static Collection<? extends Node> findUpstreamNodes(Node currentNode, String upstreamNodeType)
     a -> b1 -> b2 -> c
 
 If you call findUpstreamNodes(sdrf, c, "B"); your answer will contain b1 and b2.
 
 Note that this method will return a snapshot of the nodes currently upstream of the queried node if this method
 is called whilst the graph is being constructed.  Even if you wish to do this, often results will be correct,
 except where pooling occurs upstream of the queried node from a node that has not yet been read.
 currentNode - the current node - this method will locate all nodes upstream of this nodeupstreamNodeType - the type of nodes you are interested in locatingpublic static <T extends Node> Collection<T> findDownstreamNodes(Node currentNode, Class<T> downstreamNodeType)
NullPointerExceptions or unexpected results.
 currentNode - the current node - this method will locate all nodes downstream of this nodedownstreamNodeType - the type of nodes you are interested in locatingpublic static Collection<? extends Node> findDownstreamNodes(Node currentNode, String downstreamNodeType)
NullPointerExceptions or unexpected results.currentNode - the current node - this method will locate all nodes downstream of this nodedownstreamNodeType - the type of nodes you are interested in locatingpublic static boolean isDirectlyUpstream(Node currentNode, Node maybeUpstreamNode)
currentNode - the target node: determine whether the query node is upstream of thismaybeUpstreamNode - the node to assesspublic static boolean isDirectlyDownstream(Node currentNode, Node maybeDownstreamNode)
currentNode - the target node: determine whether the query node is downstream of thismaybeDownstreamNode - the node to assessCopyright © 2014. All rights reserved.