| Modifier and Type | Class and Description |
|---|---|
static interface |
LibraryGraph.NodeTransformer<FORMER,NEW> |
static class |
LibraryGraph.SimpleNode<T> |
| Constructor and Description |
|---|
LibraryGraph() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(T parentNode,
T childNode)
will create either the parent or the child if they didn't exist already
|
void |
addNode(T node) |
int |
cardEdge(IDENT src,
IDENT dest) |
<X> List<X> |
collect(org.apache.commons.collections.Transformer transformer) |
protected T |
createIfNotExists(T node) |
void |
disconnect(IDENT src,
IDENT dest)
totally remove any inbound/outbound edges between the two nodes
|
List<T> |
filter(org.apache.commons.collections.Predicate predicate) |
<X> List<X> |
filterAndcollect(org.apache.commons.collections.Predicate predicate,
org.apache.commons.collections.Transformer transformer)
first we'll filter, then we'll collect.
|
List<T> |
getChildless() |
T |
getNode(IDENT key) |
Collection<T> |
getNodes() |
List<T> |
getOrphans() |
boolean |
hasEdge(IDENT src,
IDENT dest) |
<OIDENT,ON extends GraphNode<OIDENT,ON>,OG extends LibraryGraph<OIDENT,ON>> |
mergeGraph(OG othergraph,
LibraryGraph.NodeTransformer<ON,T> transformer)
Will merge the structure of a graph into this graph.
|
void |
removeAllEdges(IDENT src,
IDENT dest)
remove all edges from src to dest, reducing effectively the cardinality to 0
(one cannot navigate from src to dest anymore)
|
void |
removeEdge(IDENT src,
IDENT dest)
remove one edge from src to dest, not all of them (in case of cardinality > 1)
|
void |
removeNode(IDENT target) |
<OIDENT,ON extends GraphNode<OIDENT,ON>,OG extends LibraryGraph<OIDENT,ON>> |
substractGraph(OG othergraph,
LibraryGraph.NodeTransformer<ON,T> transformer,
boolean removeAll)
Will remove from this graph any edge that exists in othergraph.
|
public Collection<T> getNodes()
public void addNode(T node)
public void addEdge(T parentNode, T childNode)
parentData - childData - public void removeNode(IDENT target)
public void removeEdge(IDENT src, IDENT dest)
public void removeAllEdges(IDENT src, IDENT dest)
public void disconnect(IDENT src, IDENT dest)
src - dest - public <X> List<X> collect(org.apache.commons.collections.Transformer transformer)
public <X> List<X> filterAndcollect(org.apache.commons.collections.Predicate predicate, org.apache.commons.collections.Transformer transformer)
public <OIDENT,ON extends GraphNode<OIDENT,ON>,OG extends LibraryGraph<OIDENT,ON>> void mergeGraph(OG othergraph, LibraryGraph.NodeTransformer<ON,T> transformer)
Will merge the structure of a graph into this graph. This means that nodes will be created if no equivalent exist already,
same goes for inbound/outbound edges . You must provide an implementation of LibraryGraph.NodeTransformer
in order to allow the conversion of a node from the other graph into a node acceptable for this graph.
The merge Nodes and edges inserted that way will not erase existing data provided if nodes having same keys are already present.
The generics are the following :
othergraph - public <OIDENT,ON extends GraphNode<OIDENT,ON>,OG extends LibraryGraph<OIDENT,ON>> void substractGraph(OG othergraph, LibraryGraph.NodeTransformer<ON,T> transformer, boolean removeAll)
othergraph - transformer - removeAll - Copyright © 2010–2016 Henix, henix.fr. All rights reserved.