public class MDAGNode extends Object
| Constructor and Description |
|---|
MDAGNode(boolean isAcceptNode)
建立一个节点
Constructs an MDAGNode. |
| Modifier and Type | Method and Description |
|---|---|
MDAGNode |
addOutgoingTransition(char letter,
boolean targetAcceptStateStatus)
新建一个转移目标
Creates an outgoing _transition labeled with a given char that has a new node as its target. |
MDAGNode |
addOutgoingTransition(char letter,
MDAGNode newTargetNode)
建立一条边(起点是自己)
|
void |
clearStoredHashCode()
Clears this node's stored hash value
|
MDAGNode |
clone()
克隆一个状态
Creates an MDAGNode possessing the same accept state status and outgoing transitions as this node. |
MDAGNode |
clone(MDAGNode soleParentNode,
char parentToCloneTransitionLabelChar)
克隆一个状态
原来soleParentNode转移到本状态,现在转移到克隆后的状态 Creates an MDAGNode possessing the same accept state status ant _transition set (incoming & outgoing) as this node. |
void |
decrementTargetIncomingTransitionCounts()
本状态的目标状态们的入度减一
Decrements (by 1) the incoming _transition counts of all of the nodes
that are targets of outgoing transitions from this node.
|
boolean |
equals(Object obj)
两个状态是否等价,只有状态转移函数完全一致才算相等
Evaluates the equality of this node with another object. |
int |
getIncomingTransitionCount()
Retrieves this node's incoming _transition count
|
int |
getOutgoingTransitionCount()
Retrieves this node's outgoing _transition count.
|
TreeMap<Character,MDAGNode> |
getOutgoingTransitions()
Retrieves this node's outgoing transitions.
|
Stack<MDAGNode> |
getTransitionPathNodes(String str)
获取一个字符串路径上经过的节点
Retrieves the nodes in the _transition path starting from this node corresponding to a given String . |
int |
getTransitionSetBeginIndex()
Retrieves the index in a simplified mdag data array that the SimpleMDAGNode
representation of this node's outgoing _transition set begins at.
|
int |
hashCode()
Hashes this node using its accept state status and set of outgoing _transition paths.
|
boolean |
hasOutgoingTransition(char letter)
Determines whether this node has an outgoing _transition with a given label.
|
boolean |
hasTransitions()
Determines whether this node has any outgoing transitions.
|
static boolean |
haveSameTransitions(MDAGNode node1,
MDAGNode node2)
是否含有相同的转移函数
|
boolean |
isAcceptNode()
Retrieves the accept state status of this node.
|
boolean |
isConfluenceNode()
Determines if this node is a confluence node
(defined as a node with two or more incoming transitions
|
void |
reassignOutgoingTransition(char letter,
MDAGNode oldTargetNode,
MDAGNode newTargetNode)
重新设置转移状态函数的目标
Reassigns the target node of one of this node's outgoing transitions.
|
void |
removeOutgoingTransition(char letter)
移除一个转移目标
Removes a _transition labeled with a given char. |
void |
setAcceptStateStatus(boolean isAcceptNode)
Sets this node's accept state status.
|
void |
setTransitionSetBeginIndex(int transitionSetBeginIndex)
转移状态在数组中的起始下标
Records the index that this node's _transition set starts at in an array containing this node's containing MDAG data (simplified MDAG). |
String |
toString() |
MDAGNode |
transition(char letter)
Follows an outgoing _transition of this node labeled with a given char.
|
MDAGNode |
transition(char[] str) |
MDAGNode |
transition(char[] str,
int offset) |
MDAGNode |
transition(String str)
沿着一个路径转移
Follows a _transition path starting from this node. |
public MDAGNode(boolean isAcceptNode)
isAcceptNode - 是否是终止状态 a boolean denoting the accept state status of this nodepublic MDAGNode clone()
public MDAGNode clone(MDAGNode soleParentNode, char parentToCloneTransitionLabelChar)
soleParentNode - the MDAGNode possessing the only _transition that targets this nodeparentToCloneTransitionLabelChar - the char which labels the _transition from soleParentNode to this nodepublic int getTransitionSetBeginIndex()
public int getOutgoingTransitionCount()
public int getIncomingTransitionCount()
public boolean isConfluenceNode()
public boolean isAcceptNode()
public void setAcceptStateStatus(boolean isAcceptNode)
isAcceptNode - a boolean representing the desired accept state statuspublic void setTransitionSetBeginIndex(int transitionSetBeginIndex)
transitionSetBeginIndex - a _transition setpublic boolean hasOutgoingTransition(char letter)
letter - the char labeling the desired _transitionletter, and false otherwisepublic boolean hasTransitions()
public MDAGNode transition(char letter)
letter - the char representation of the desired _transition's labelletter,
or null if there is no such labeled _transition from this nodepublic MDAGNode transition(String str)
str - a String corresponding a _transition path in the MDAGstr, or null if such a _transition path is not present in the MDAGpublic MDAGNode transition(char[] str)
public MDAGNode transition(char[] str, int offset)
public Stack<MDAGNode> getTransitionPathNodes(String str)
str - a String corresponding to a _transition path starting from this nodestr, in the order they are encountered in during transitioningpublic TreeMap<Character,MDAGNode> getOutgoingTransitions()
public void decrementTargetIncomingTransitionCounts()
public void reassignOutgoingTransition(char letter,
MDAGNode oldTargetNode,
MDAGNode newTargetNode)
letter - the char which labels the outgoing _transition of interestoldTargetNode - the MDAGNode that is currently the target of the _transition of interestnewTargetNode - the MDAGNode that is to be the target of the _transition of interestpublic MDAGNode addOutgoingTransition(char letter, boolean targetAcceptStateStatus)
letter - a char representing the desired label of the _transitiontargetAcceptStateStatus - a boolean representing to-be-created _transition target node's accept statuspublic MDAGNode addOutgoingTransition(char letter, MDAGNode newTargetNode)
letter - 边上的字符串newTargetNode - 边的重点public void removeOutgoingTransition(char letter)
letter - the char labeling the _transition of interestpublic static boolean haveSameTransitions(MDAGNode node1, MDAGNode node2)
node1 - node2 - public void clearStoredHashCode()
public boolean equals(Object obj)
public int hashCode()
Copyright © 2014–2021 码农场. All rights reserved.