public interface Subgraph extends Graph
A subgraph has the same or less elements compared to the graph it's based on. This interface inherits from Graph and all read operations behave in a similar fashion. For instance, calling getNodes will return only nodes in this subgraph. However, write operations such as addNode or removeNode are used to control which elements are part of the view.
Modifier and Type | Method and Description |
---|---|
boolean |
addAllEdges(Collection<? extends Edge> edges)
Adds a collection of edges to this subgraph.
|
boolean |
addAllNodes(Collection<? extends Node> nodes)
Adds a collection of nodes to this subgraph.
|
boolean |
addEdge(Edge edge)
Adds an edge to this subgraph.
|
boolean |
addNode(Node node)
Adds a node to this subgraph.
|
void |
fill()
Fills the subgraph so all elements in the graph are in the subgraph.
|
Graph |
getRootGraph()
Return the root graph this subgraph is based on.
|
GraphView |
getView()
Gets the view associated with this subgraph.
|
void |
intersection(Subgraph subGraph)
Intersects the given subgraph with this sugbgraph.
|
void |
not()
Inverse this subgraph so all elements in the graph are removed and all
elements not in the graph are added.
|
boolean |
removeAllEdges(Collection<? extends Edge> edges)
Removes a collection of edges from this subgraph.
|
boolean |
removeAllNodes(Collection<? extends Node> nodes)
Removes a collection of nodes from this subgraph.
|
boolean |
removeEdge(Edge edge)
Removes an edge from this subgraph.
|
boolean |
removeNode(Node node)
Removes a node from this subgraph.
|
void |
union(Subgraph subGraph)
Unions the given subgraph with this sugbgraph.
|
clear, clearEdges, clearEdges, clearEdges, contains, contains, getAttribute, getAttribute, getAttribute, getAttributeKeys, getDegree, getEdge, getEdge, getEdge, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdges, getEdges, getEdges, getModel, getNeighbors, getNeighbors, getNode, getNodeCount, getNodes, getOpposite, getSelfLoops, hasEdge, hasNode, isAdjacent, isAdjacent, isDirected, isDirected, isIncident, isIncident, isMixed, isSelfLoop, isUndirected, readLock, readUnlock, readUnlockAll, removeAttribute, removeAttribute, removeAttribute, setAttribute, setAttribute, setAttribute, writeLock, writeUnlock
GraphView getView()
Graph getRootGraph()
boolean addNode(Node node)
The node should be part of the root graph.
boolean addAllNodes(Collection<? extends Node> nodes)
The nodes should be part of the root graph.
addAllNodes
in interface Graph
nodes
- the nodes to addboolean addEdge(Edge edge)
The edge should be part of the root graph.
boolean addAllEdges(Collection<? extends Edge> edges)
The edges should be part of the root graph.
addAllEdges
in interface Graph
edges
- the edges to addboolean removeNode(Node node)
The node should be part of the root graph.
removeNode
in interface Graph
node
- the node to removeboolean removeAllNodes(Collection<? extends Node> nodes)
The nodes should be part of the root graph.
removeAllNodes
in interface Graph
nodes
- the nodes to removeboolean removeEdge(Edge edge)
The edge should be part of the root graph.
removeEdge
in interface Graph
edge
- the edge to removeboolean removeAllEdges(Collection<? extends Edge> edges)
The edges should be part of the root graph.
removeAllEdges
in interface Graph
edges
- the edges to removevoid fill()
void union(Subgraph subGraph)
The given subgraph remains unchanged.
subGraph
- the subgraph to do the union withvoid intersection(Subgraph subGraph)
The given subgraph remains unchanged.
subGraph
- the subgraph to do the intersection withvoid not()
Copyright © 2007–2017 Gephi Consortium. All rights reserved.