S - (hypothesis) state typeI - input alphabet typeO - output alphabet typeN - the concrete node typepublic interface RecursiveADSNode<S,I,O,N extends RecursiveADSNode<S,I,O,N>> extends Graph<N,N>
For convenience, this interface extends the Graph interface so that an ADS may be passed easily to e.g.
GraphDOT methods.
This is a utility interface with a recursive generic type parameter to allow for better inheritance with this
recursive data structure. Algorithms may use more simplified sub-interfaces such as ADSNode.
SimpleGraph.NormalGraphView<N,G extends SimpleGraph<N>>| Modifier and Type | Method and Description |
|---|---|
Map<O,N> |
getChildren()
Returns a mapping to the child nodes of
this ADS node. |
S |
getHypothesisState()
Returns the hypothesis state associated with this ADS node.
|
default Collection<N> |
getNodesForRoot(N root)
A utility method to collect all nodes of a subtree specified by the given root node.
|
default Collection<N> |
getOutgoingEdges(N node)
Retrieves the outgoing edges of a given node.
|
N |
getParent()
Returns the parent node of
this node. |
I |
getSymbol()
Returns the input symbol associated with this ADS node.
|
default N |
getTarget(N edge)
Retrieves, for a given edge, its target node.
|
default VisualizationHelper<N,N> |
getVisualizationHelper() |
boolean |
isLeaf()
A utility method indicating whether
this node represents a leaf of an ADS (and therefore referencing a
hypothesis state) or an inner node (and therefore referencing an input symbol). |
void |
setHypothesisState(S state)
See
getHypothesisState(). |
void |
setParent(N parent) |
void |
setSymbol(I symbol)
See
getSymbol(). |
asNormalGraphadjacentTargetsIterator, adjacentTargetsStream, getAdjacentTargets, getEdgesBetween, outgoingEdges, outgoingEdgesIterator, outgoingEdgesStreamgetNodes, iterator, nodeIDs, nodesStream, sizeadjacentTargets, createDynamicNodeMapping, createStaticNodeMapping, isConnectedforEach, spliteratorI getSymbol()
null if this is a leaf node (see isLeaf()), the associated input symbol
otherwise.void setSymbol(I symbol) throws UnsupportedOperationException
getSymbol().symbol - the input symbol to be associated with this ADS node.UnsupportedOperationException - if trying to set an input symbol on a leaf node (see isLeaf()).N getParent()
this node.this ADS node. May be null, if this is the root node of an
ADS.void setParent(N parent)
default Collection<N> getNodesForRoot(N root)
SimpleGraph.getNodes() implementation where a concrete type for N is needed.root - the node for which all subtree nodes should be collectedMap<O,N> getChildren()
this ADS node.null.default Collection<N> getOutgoingEdges(N node)
IndefiniteGraphgetOutgoingEdges in interface IndefiniteGraph<N extends RecursiveADSNode<S,I,O,N>,N extends RecursiveADSNode<S,I,O,N>>node - the node.Collection of all outgoing edges, or null if the node has no outgoing edges.default N getTarget(N edge)
IndefiniteGraphgetTarget in interface IndefiniteGraph<N extends RecursiveADSNode<S,I,O,N>,N extends RecursiveADSNode<S,I,O,N>>edge - the edge.default VisualizationHelper<N,N> getVisualizationHelper()
getVisualizationHelper in interface Graph<N extends RecursiveADSNode<S,I,O,N>,N extends RecursiveADSNode<S,I,O,N>>getVisualizationHelper in interface SimpleGraph<N extends RecursiveADSNode<S,I,O,N>>boolean isLeaf()
this node represents a leaf of an ADS (and therefore referencing a
hypothesis state) or an inner node (and therefore referencing an input symbol).true if this is a leaf of an ADS, false otherwise.S getHypothesisState()
null if this is an inner node (see isLeaf()), the associated hypothesis state
otherwise.void setHypothesisState(S state) throws UnsupportedOperationException
getHypothesisState().state - the hypothesis state to be associated with this ADS node.UnsupportedOperationException - if trying to set a hypothesis state on an inner node (see isLeaf()).Copyright © 2018. All rights reserved.