DSCR - type of discrimantorI - input symbol typeO - output symbol typeD - data symbol typeN - node typepublic abstract class AbstractDiscriminationTree<DSCR,I,O,D,N extends AbstractDTNode<DSCR,O,D,N>> extends Object implements Graph<N,Map.Entry<O,N>>, Serializable
SimpleGraph.NormalGraphView<N,G extends SimpleGraph<N>>| Modifier and Type | Field and Description |
|---|---|
protected MembershipOracle<I,O> |
oracle |
protected N |
root |
| Constructor and Description |
|---|
AbstractDiscriminationTree(N root,
MembershipOracle<I,O> oracle) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract DefaultQuery<I,O> |
buildQuery(N node,
Word<I> prefix) |
Collection<N> |
getNodes() |
Collection<Map.Entry<O,N>> |
getOutgoingEdges(N node) |
N |
getRoot() |
N |
getTarget(Map.Entry<O,N> edge) |
VisualizationHelper<N,Map.Entry<O,N>> |
getVisualizationHelper() |
LCAInfo<O,N> |
lcaInfo(N node1,
N node2)
Fetches for two nodes information about their lowest common ancestor in
this discrimination tree. |
N |
leastCommonAncestor(N a,
N b) |
void |
setOracle(MembershipOracle<I,O> oracle) |
List<N> |
sift(List<N> starts,
List<Word<I>> prefixes) |
protected List<N> |
sift(List<N> starts,
List<Word<I>> prefixes,
Predicate<N> continueExploring) |
N |
sift(N start,
Word<I> prefix) |
protected N |
sift(N start,
Word<I> prefix,
Predicate<N> continueExploring) |
N |
sift(Word<I> prefix) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasNormalGraphadjacentTargetsIterator, adjacentTargetsStream, getAdjacentTargets, getEdgesBetween, outgoingEdges, outgoingEdgesIterator, outgoingEdgesStreamiterator, nodeIDs, nodesStream, sizeadjacentTargets, createDynamicNodeMapping, createStaticNodeMapping, isConnectedforEach, spliteratorprotected transient MembershipOracle<I,O> oracle
public AbstractDiscriminationTree(N root, MembershipOracle<I,O> oracle)
public N getRoot()
public LCAInfo<O,N> lcaInfo(N node1, N node2)
this discrimination tree. LCAInfo.subtree1Label will reference the label of the outgoing child transition for the node closer to the LCA,
LCAInfo.subtree2Label the label of the outgoing child transition for the node farther away from the LCA.
If both nodes have equal depth, LCAInfo.subtree1Label contains node1's label and LCAInfo.subtree2Label node2's label.
Either LCAInfo.subtree1Label or LCAInfo.subtree2Label is null, if node1 (node2 respectively) already is the LCA.
node1 - first nodenode2 - second nodeLCAInfo.public Collection<N> getNodes()
getNodes in interface SimpleGraph<N extends AbstractDTNode<DSCR,O,D,N>>public Collection<Map.Entry<O,N>> getOutgoingEdges(N node)
getOutgoingEdges in interface IndefiniteGraph<N extends AbstractDTNode<DSCR,O,D,N>,Map.Entry<O,N extends AbstractDTNode<DSCR,O,D,N>>>public VisualizationHelper<N,Map.Entry<O,N>> getVisualizationHelper()
getVisualizationHelper in interface Graph<N extends AbstractDTNode<DSCR,O,D,N>,Map.Entry<O,N extends AbstractDTNode<DSCR,O,D,N>>>getVisualizationHelper in interface SimpleGraph<N extends AbstractDTNode<DSCR,O,D,N>>public void setOracle(MembershipOracle<I,O> oracle)
Copyright © 2019. All rights reserved.