public final class HeapConfigurationPairBuilder extends Object implements HeapConfigurationBuilder
| 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'.
|
int |
addSingleNode(Type type)
Adds a single node of Type type to the underlying graph.
|
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 embedding,
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.
|
public HeapConfiguration build()
HeapConfigurationBuilderbuild in interface HeapConfigurationBuilderpublic HeapConfigurationBuilder addNodes(Type type, int count, gnu.trove.list.array.TIntArrayList buffer)
HeapConfigurationBuilderaddNodes in interface HeapConfigurationBuildertype - 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.public int addSingleNode(Type type)
HeapConfigurationBuilderaddSingleNode in interface HeapConfigurationBuildertype - Type of the node to be created.public HeapConfigurationBuilder removeIsolatedNode(int node)
HeapConfigurationBuilderremoveIsolatedNode in interface HeapConfigurationBuildernode - ID of the node to removepublic HeapConfigurationBuilder removeNode(int node)
HeapConfigurationBuilderremoveNode in interface HeapConfigurationBuildernode - ID of the node to removepublic HeapConfigurationBuilder addSelector(int from, SelectorLabel sel, int to)
HeapConfigurationBuilderaddSelector in interface HeapConfigurationBuilderfrom - source of the selector edgesel - label of the selector edgeto - target of the selector edgepublic HeapConfigurationBuilder removeSelector(int node, SelectorLabel sel)
HeapConfigurationBuilderremoveSelector in interface HeapConfigurationBuildernode - The node whose selector edges are taken into account.sel - The label of the selector edge that should be deleted.public HeapConfigurationBuilder replaceSelector(int node, SelectorLabel oldSel, SelectorLabel newSel)
HeapConfigurationBuilderreplaceSelector in interface HeapConfigurationBuildernode - 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.public HeapConfigurationBuilder setExternal(int node)
HeapConfigurationBuildersetExternal in interface HeapConfigurationBuildernode - The (not external yet) not to mark.public HeapConfigurationBuilder unsetExternal(int node)
HeapConfigurationBuilderunsetExternal in interface HeapConfigurationBuildernode - The external node.public HeapConfigurationBuilder addVariableEdge(String name, int target)
HeapConfigurationBuilderaddVariableEdge in interface HeapConfigurationBuildername - Name of the new variable.target - The node the new variable edge is attached to.public HeapConfigurationBuilder removeVariableEdge(int varEdge)
HeapConfigurationBuilderremoveVariableEdge in interface HeapConfigurationBuildervarEdge - The variable edge that should be removed.public HeapConfigurationBuilder addNonterminalEdge(Nonterminal label, gnu.trove.list.array.TIntArrayList attachedNodes)
HeapConfigurationBuilderaddNonterminalEdge in interface HeapConfigurationBuilderlabel - 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.public int addNonterminalEdgeAndReturnId(Nonterminal label, gnu.trove.list.array.TIntArrayList attachedNodes)
HeapConfigurationBuilderaddNonterminalEdgeAndReturnId in interface HeapConfigurationBuilderlabel - 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.public NonterminalEdgeBuilder addNonterminalEdge(Nonterminal nt)
HeapConfigurationBuilderaddNonterminalEdge in interface HeapConfigurationBuildernt - the nonterminalpublic HeapConfigurationBuilder removeNonterminalEdge(int ntEdge)
HeapConfigurationBuilderremoveNonterminalEdge in interface HeapConfigurationBuilderntEdge - The nonterminal edge to remove.public HeapConfigurationBuilder replaceNonterminal(int ntEdge, Nonterminal newNt)
HeapConfigurationBuilderreplaceNonterminal in interface HeapConfigurationBuilderntEdge - The nonterminal edge whose label should be changed.newNt - The new nonterminal label.public HeapConfigurationBuilder replaceNonterminalEdge(int ntEdge, HeapConfiguration replacement)
HeapConfigurationBuilderreplaceNonterminalEdge in interface HeapConfigurationBuilderntEdge - The nonterminal edge that should be replaced.replacement - The HeapConfiguration that should replace the hyperedge.public HeapConfigurationBuilder replaceMatching(Matching matching, Nonterminal nonterminal)
HeapConfigurationBuilderreplaceMatching in interface HeapConfigurationBuildermatching - A matching of a pattern graph in the current graph.nonterminal - The label of the nonterminal edge to be created.public HeapConfigurationBuilder replaceNodeType(int node, Type newType)
HeapConfigurationBuilderreplaceNodeType in interface HeapConfigurationBuildernode - The node whose type should be changed.newType - The new type assigned to the node.public HeapConfigurationBuilder replaceMatchingWithCollapsedExternals(Matching embedding, Nonterminal nonterminal, gnu.trove.list.array.TIntArrayList externalIndicesMap)
HeapConfigurationBuilderreplaceMatchingWithCollapsedExternals in interface HeapConfigurationBuilderembedding - A matching of a pattern graph in the current graph.nonterminal - The label of the nonterminal edge to be created.public HeapConfigurationBuilder mergeExternals(gnu.trove.list.array.TIntArrayList extIndicesMap)
HeapConfigurationBuildermergeExternals in interface HeapConfigurationBuilderextIndicesMap - 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 © 2019. All rights reserved.