public abstract class AbstractGraph<S extends Node> extends Object implements Graph<S>
| Constructor and Description | 
|---|
AbstractGraph()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addNode(S node)
Store a node in the  
Graph. | 
void | 
checkForCycles(Node node,
              Node childNode)
Assertain whether this graph contains any cycles. 
 | 
Collection<? extends S> | 
getAllNodes()
Lookup all nodes in the SDRF graph 
 | 
protected org.slf4j.Logger | 
getLog()  | 
<T extends S>  | 
getNode(String nodeName,
       Class<T> nodeType)
Lookup a node by name and class type in the SDRF graph. 
 | 
S | 
getNode(String nodeName,
       String nodeType)
Lookup a node by name and type in the SDRF graph. 
 | 
int | 
getNodeCount()
Returns the total number of nodes stored by this SDRF graph. 
 | 
<T extends S>  | 
getNodes(Class<T> nodeType)
Lookup all nodes of the given class type in the SDRF graph. 
 | 
Collection<? extends S> | 
getNodes(String nodeType)
Lookup all nodes of the given type (by SDRF spec name) in the SDRF graph. 
 | 
Collection<? extends S> | 
getRootNodes()
Lookup all 'root' nodes in the SDRF graph. 
 | 
void | 
removeNode(Node node)
Remove a node that was previously stored in the  
Graph. | 
void | 
resolveGraphStructure(S node)
Update this node being stored with appropriate references to it's parents and update any child node references
 that are already present in the graph. 
 | 
void | 
updateNode(S node)
Updates an node in the SDRF graph, on the assumption that its position in the graph, or its children, have been
 altered. 
 | 
protected org.slf4j.Logger getLog()
public void addNode(S node) throws ParseException
GraphGraph.  This node will be added to the internal graph representation of nodes
 represented by the graph object.  In this way, this graph object represents the data encoded by the spreadsheet
 rather than directly representing the spreadsheet data structure.addNode in interface Graph<S extends Node>node - the node to storeParseException - if the node being stored would violate the principle that the graph is acyclicpublic void removeNode(Node node)
GraphGraph.  This node will be taken out of the internal graph
 representation of nodes represented by this object.
 
 Note: this method also removes any references elsewhere in the graph to this Node, from parent and child nodes.
 You should relink your graph around the removed node once you have taken it out: but be warned, this may
 compromise the structure of the graph.removeNode in interface Graph<S extends Node>node - the node to removepublic void updateNode(S node) throws ParseException
GraphupdateNode in interface Graph<S extends Node>node - the node that needs updatingParseException - if the node being stored would violate the principle that the graph is acyclicpublic <T extends S> T getNode(String nodeName, Class<T> nodeType)
Graphpublic S getNode(String nodeName, String nodeType)
Graphpublic Collection<? extends S> getAllNodes()
GraphgetAllNodes in interface Graph<S extends Node>public <T extends S> Collection<T> getNodes(Class<T> nodeType)
Graphpublic Collection<? extends S> getNodes(String nodeType)
Graphpublic Collection<? extends S> getRootNodes()
GraphGraph.getNodes(Class), substituting the class parameter
 for the known root node type.getRootNodes in interface Graph<S extends Node>public int getNodeCount()
GraphgetNodeCount in interface Graph<S extends Node>public void resolveGraphStructure(S node) throws ParseException
GraphresolveGraphStructure in interface Graph<S extends Node>node - the node being storedParseException - if the node being stored would violate the principle that the graph is acyclicpublic void checkForCycles(Node node, Node childNode) throws ParseException
GraphcheckForCycles in interface Graph<S extends Node>node - the node to checkchildNode - the child node that should be addedParseException - if a cycle is detectedCopyright © 2014. All rights reserved.