public interface HeapConfigurationBuilder
A HeapConfigurationBuilder allows to mutate a given HeapConfiguration.
Hence, as long as a HeapConfigurationBuilder exists for a HeapConfiguration,
the HeapConfiguration is mutable.
It is set to an immutable HeapConfiguration again by calling
build().
There is always at most one HeapConfigurationBuilder for each HeapConfiguration.
| Modifier and Type | Method and Description |
|---|---|
HeapConfigurationBuilder |
addNodes(Type type,
int count,
gnu.trove.list.array.TIntArrayList buffer)
Add count nodes of Type type to the underlying graph.
|
NonterminalEdgeBuilder |
addNonterminalEdge(Nonterminal nt)
gets a nonterminalEdgeBuilder that allows to specify the tentacles of this nonterminal
and add the resulting edge to the graph
|
HeapConfigurationBuilder |
addNonterminalEdge(Nonterminal label,
gnu.trove.list.array.TIntArrayList attachedNodes)
Adds a new nonterminal edge.
|
int |
addNonterminalEdgeAndReturnId(Nonterminal label,
gnu.trove.list.array.TIntArrayList attachedNodes)
Adds a new nonterminal edge and returns the respective id
|
HeapConfigurationBuilder |
addSelector(int from,
SelectorLabel sel,
int to)
Adds a new selector edge that is labeled with 'sel' and points from node 'from' to node 'to'.
|
HeapConfigurationBuilder |
addVariableEdge(String name,
int target)
Adds a new, not already existing, variable edge and attaches it to the given target node.
|
HeapConfiguration |
build()
Marks the underlying HeapConfiguration as immutable again (until a new builder is requested).
|
HeapConfigurationBuilder |
mergeExternals(gnu.trove.list.array.TIntArrayList extIndicesMap)
Merges external nodes according to the provided index map.
|
HeapConfigurationBuilder |
removeIsolatedNode(int node)
Removes an isolated node from the underlying HeapConfiguration
|
HeapConfigurationBuilder |
removeNode(int node)
Removes the given node from the underlying HeapConfiguration.
|
HeapConfigurationBuilder |
removeNonterminalEdge(int ntEdge)
Removes a given nonterminal edge.
|
HeapConfigurationBuilder |
removeSelector(int node,
SelectorLabel sel)
Removes an outgoing selector edge with the provided label 'sel' from the node 'node'.
|
HeapConfigurationBuilder |
removeVariableEdge(int varEdge)
Removes the provided variable edge.
|
HeapConfigurationBuilder |
replaceMatching(Matching matching,
Nonterminal nonterminal)
Replaces the graph captured by the provided matching by a fresh nonterminal edge labeled with the provided nonterminal.
|
HeapConfigurationBuilder |
replaceMatchingWithCollapsedExternals(Matching matching,
Nonterminal nonterminal,
gnu.trove.list.array.TIntArrayList externalIndicesMap)
Replaces the graph captured by the provided matching by a fresh nonterminal edge labeled with the provided nonterminal.
|
HeapConfigurationBuilder |
replaceNodeType(int node,
Type newType)
Sets the node type of the given node to newType.
|
HeapConfigurationBuilder |
replaceNonterminal(int ntEdge,
Nonterminal newNt)
Substitutes the label of a given nonterminal edge by the provided label.
|
HeapConfigurationBuilder |
replaceNonterminalEdge(int ntEdge,
HeapConfiguration replacement)
Performs hyperedge replacement for the given nonterminal edge and the given HeapConfiguration.
|
HeapConfigurationBuilder |
replaceSelector(int node,
SelectorLabel oldSel,
SelectorLabel newSel)
Replaces the original label of an outgoing selector edge with label 'oldSel' of node 'node' by
the selector label 'newSel'.
|
HeapConfigurationBuilder |
setExternal(int node)
Marks a node as external.
|
HeapConfigurationBuilder |
unsetExternal(int node)
Marks an external node as not external.
|
HeapConfiguration build()
HeapConfigurationBuilder addNodes(Type type, int count, gnu.trove.list.array.TIntArrayList buffer)
type - Type of the nodes to be created.count - The number of nodes to be created.buffer - A list in which all created nodes are added.HeapConfigurationBuilder removeIsolatedNode(int node)
node - ID of the node to removeHeapConfigurationBuilder removeNode(int node)
node - ID of the node to removeHeapConfigurationBuilder addSelector(int from, SelectorLabel sel, int to)
from - source of the selector edgesel - label of the selector edgeto - target of the selector edgeHeapConfigurationBuilder removeSelector(int node, SelectorLabel sel)
node - The node whose selector edges are taken into account.sel - The label of the selector edge that should be deleted.HeapConfigurationBuilder replaceSelector(int node, SelectorLabel oldSel, SelectorLabel newSel)
node - The node whose selector edges are taken into account.oldSel - The original label of the selector edge to be replaced.newSel - The new label of the selector edge to be replaced.HeapConfigurationBuilder setExternal(int node)
node - The (not external yet) not to mark.HeapConfigurationBuilder unsetExternal(int node)
node - The external node.HeapConfigurationBuilder addVariableEdge(String name, int target)
name - Name of the new variable.target - The node the new variable edge is attached to.HeapConfigurationBuilder removeVariableEdge(int varEdge)
varEdge - The variable edge that should be removed.HeapConfigurationBuilder addNonterminalEdge(Nonterminal label, gnu.trove.list.array.TIntArrayList attachedNodes)
label - The label of the new edge.attachedNodes - The list of nodes attached to the new edge.
The size of this list must coincide with the rank of label.int addNonterminalEdgeAndReturnId(Nonterminal label, gnu.trove.list.array.TIntArrayList attachedNodes)
label - The label of the new edge.attachedNodes - The list of nodes attached to the new edge.
The size of this list must coincide with the rank of label.NonterminalEdgeBuilder addNonterminalEdge(Nonterminal nt)
nt - the nonterminalHeapConfigurationBuilder removeNonterminalEdge(int ntEdge)
ntEdge - The nonterminal edge to remove.HeapConfigurationBuilder replaceNonterminal(int ntEdge, Nonterminal newNt)
ntEdge - The nonterminal edge whose label should be changed.newNt - The new nonterminal label.HeapConfigurationBuilder replaceNonterminalEdge(int ntEdge, HeapConfiguration replacement)
ntEdge - The nonterminal edge that should be replaced.replacement - The HeapConfiguration that should replace the hyperedge.HeapConfigurationBuilder replaceMatching(Matching matching, Nonterminal nonterminal)
matching - A matching of a pattern graph in the current graph.nonterminal - The label of the nonterminal edge to be created.HeapConfigurationBuilder replaceNodeType(int node, Type newType)
node - The node whose type should be changed.newType - The new type assigned to the node.HeapConfigurationBuilder replaceMatchingWithCollapsedExternals(Matching matching, Nonterminal nonterminal, gnu.trove.list.array.TIntArrayList externalIndicesMap)
matching - A matching of a pattern graph in the current graph.nonterminal - The label of the nonterminal edge to be created.externalIndicesMap - HeapConfigurationBuilder mergeExternals(gnu.trove.list.array.TIntArrayList extIndicesMap)
extIndicesMap - A mapping from external node positions in the current graph to external node positions
in the resulting graph, e.g. {0,1,2,0} in order to merge the first and last node.Copyright © 2018. All rights reserved.