com.hankcs.hanlp.collection.MDAG
类 SimpleMDAGNode

java.lang.Object
  继承者 com.hankcs.hanlp.collection.MDAG.SimpleMDAGNode
所有已实现的接口:
ICacheAble

public class SimpleMDAGNode
extends Object
implements ICacheAble

The class capable of representing a MDAG node, its _transition set, and one of its incoming transitions; objects of this class are used to represent a MDAG after its been simplified in order to save space.

作者:
Kevin

构造方法摘要
SimpleMDAGNode()
           
SimpleMDAGNode(char letter, boolean isAcceptNode, int transitionSetSize)
          Constructs a SimpleMDAGNode.
 
方法摘要
 char getLetter()
          Retrieves the character representing the _transition laben leading up to this node.
 int getOutgoingTransitionSetSize()
          Retrieves the size of this node's outgoing _transition set.
 int getTransitionSetBeginIndex()
          Retrieves the index in this node's containing array that its _transition set begins at.
 boolean isAcceptNode()
          Retrieves the accept state status of this node.
 boolean load(ByteArray byteArray)
          载入
 void save(DataOutputStream out)
          写入
 void setTransitionSetBeginIndex(int transitionSetBeginIndex)
          Records the index in this node's containing array that its _transition set begins at.
 String toString()
           
 SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray, char letter)
          Follows an outgoing _transition from this node.
 SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray, char[] str)
           
 SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray, char[] str, int offset)
           
 SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray, String str)
          Follows a _transition path starting from this node.
static SimpleMDAGNode traverseMDAG(SimpleMDAGNode[] mdagDataArray, SimpleMDAGNode sourceNode, String str)
          Follows a _transition path starting from the source node of a MDAG.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

SimpleMDAGNode

public SimpleMDAGNode(char letter,
                      boolean isAcceptNode,
                      int transitionSetSize)
Constructs a SimpleMDAGNode.

参数:
letter - a char representing the _transition label leading to this SimpleMDAGNode
isAcceptNode - a boolean representing the accept state status of this SimpleMDAGNode
transitionSetSize - an int denoting the size of this _transition set

SimpleMDAGNode

public SimpleMDAGNode()
方法详细信息

getLetter

public char getLetter()
Retrieves the character representing the _transition laben leading up to this node.

返回:
the char representing the _transition label leading up to this node

isAcceptNode

public boolean isAcceptNode()
Retrieves the accept state status of this node.

返回:
true if this node is an accept state, false otherwise

getTransitionSetBeginIndex

public int getTransitionSetBeginIndex()
Retrieves the index in this node's containing array that its _transition set begins at.

返回:
an int of the index in this node's containing array at which its _transition set begins

getOutgoingTransitionSetSize

public int getOutgoingTransitionSetSize()
Retrieves the size of this node's outgoing _transition set.

返回:
an int denoting the size of this node's outgoing _transition set

setTransitionSetBeginIndex

public void setTransitionSetBeginIndex(int transitionSetBeginIndex)
Records the index in this node's containing array that its _transition set begins at.

参数:
transitionSetBeginIndex - an int denoting the index in this node's containing array that is _transition set beings at

transition

public SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray,
                                 char letter)
Follows an outgoing _transition from this node.

参数:
mdagDataArray - the array of SimpleMDAGNodes containing this node
letter - the char representation of the desired _transition's label
返回:
the SimpleMDAGNode that is the target of the _transition labeled with letter, or null if there is no such labeled _transition from this node

transition

public SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray,
                                 String str)
Follows a _transition path starting from this node.

参数:
mdagDataArray - the array of SimpleMDAGNodes containing this node
str - a String corresponding a _transition path in the MDAG
返回:
the SimpleMDAGNode at the end of the _transition path corresponding to str, or null if such a _transition path is not present in the MDAG

transition

public SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray,
                                 char[] str)

transition

public SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray,
                                 char[] str,
                                 int offset)

traverseMDAG

public static SimpleMDAGNode traverseMDAG(SimpleMDAGNode[] mdagDataArray,
                                          SimpleMDAGNode sourceNode,
                                          String str)
Follows a _transition path starting from the source node of a MDAG.

参数:
mdagDataArray - the array containing the data of the MDAG to be traversed
sourceNode - the dummy SimpleMDAGNode which functions as the source of the MDAG data in mdagDataArray
str - a String corresponding to a _transition path in the to-be-traversed MDAG
返回:
the SimpleMDAGNode at the end of the _transition path corresponding to str, or null if such a _transition path is not present in the MDAG

toString

public String toString()
覆盖:
Object 中的 toString

save

public void save(DataOutputStream out)
          throws Exception
从接口 ICacheAble 复制的描述
写入

指定者:
接口 ICacheAble 中的 save
抛出:
Exception

load

public boolean load(ByteArray byteArray)
从接口 ICacheAble 复制的描述
载入

指定者:
接口 ICacheAble 中的 load
返回:


Copyright © 2014–2015 鐮佸啘鍦�/a>. All rights reserved.