Package ghidra.graph

Class MutableGDirectedGraphWrapper<V,E extends GEdge<V>>

java.lang.Object
ghidra.graph.MutableGDirectedGraphWrapper<V,E>
Type Parameters:
V - the vertex type
E - the edge type
All Implemented Interfaces:
GDirectedGraph<V,E>, GImplicitDirectedGraph<V,E>

public class MutableGDirectedGraphWrapper<V,E extends GEdge<V>> extends Object implements GDirectedGraph<V,E>
A class that can wrap a GDirectedGraph and allows for vertex and edge additions without changing the underlying graph.

Warning: As mentioned above, this graph is meant for additive operations. In its current form, removal operations will not work. To facilitate removals, this class will have to be updated to track removed vertices and edges, using them to correctly report the state of the graph for methods like containsVertex(Object) and containsEdge(GEdge).

Implementation Note: there is some 'magic' in this class to add 'dummy' vertices to the graph. To facilitate this, the mutated graph in this class does not have the V type, but rather is typed on Object. This means that this class can only be used generically, with templated types (like by algorithms and such). Any usage of this class that expects concrete implementations to be returned can trigger ClassCastExceptions.