unot
クラス Pattern

java.lang.Object
  |
  +--unot.Pattern
すべての実装インタフェース:
java.lang.Cloneable
直系の既知のサブクラス:
MatchPattern, UnotPattern

public class Pattern
extends java.lang.Object
implements java.lang.Cloneable

Pattern.java このクラスは UNOT パターンのデータ構造を表現する. (trcs216.pdf pp.8 Fig.4) Created: Thu Aug 7 20:34:14 2003


フィールドの概要
private static int _freePatId
          Pattern の通し番号 ID
protected  unot.DLpair[] code
          (depth, label) 対の列
(パッケージプライベート) static unot.DocSet docSet
          木の清書出力用のdocsetオブジェクト
protected  int id
          パターンの通し番号.
static int INFTY_INDEX
          Infinity Node への仮想インデックス.
(パッケージプライベート) static unot.PatternReader reader
          木の清書入力手続き
protected  int[] right
          code における右木への添字インデックス値の配列
protected  int rootCount
          根出現となるノードのリスト.オプション
protected  unot.NodeList rootList
          根出現となるノードのリスト.オプション
(パッケージプライベート) static unot.PatternWriter writer
          木の清書出力手続き
 
コンストラクタの概要
Pattern()
          Creates a new Pattern instance.
Pattern(unot.DLpair[] code, int[] right)
          Creates a new Pattern instance.
Pattern(int rootLabel)
          Returns a Pattern object that has only root node.
 
メソッドの概要
 java.lang.Object clone()
          Returns a cloned object.
 int getCodeSize()
          Get the code size (= the number of nodes).
 int getId()
           
 unot.DLpair getNodeAt(int i)
          Get the depth-label pair for the i-th node.
 int getNodeIndex(int depth)
          Gets the index of the node on the `code' array of this object.
 int getNodeLabel(int depth)
          Gets the label of the rightmost branch node at the depth.
(パッケージプライベート) static int getPatId()
           
static unot.PatternWriter getPatternWriter()
          パターン出力ルーチンを返す.
 int[] getRight()
           
 int getRightIndex(int depth)
          Gets the index of the depth in the rightmost branch.
 int getRootCount()
           
 unot.NodeList getRootList()
           
 int getTopDepth()
          Get the top depth of the rightmost branch.
 int getTopIndex()
          Gets the top index of the `code' array of this object.
 boolean isInftyNode(int depth)
          Distinguish whether the depth node is Infinity Node or not.
 unot.Pattern rightmostExpand(unot.Pattern oldPattern, unot.DLpair newNode, int succCopyDepth)
          Returns a Pattern which is expanded with the Rightmost Expantion.
 void setId(int id)
           
static void setPatternReader(unot.PatternReader reader)
          パターン入力ルーチンを設定する.
static void setPatternWriter(unot.PatternWriter writer)
          パターン出力ルーチンを設定する.
 void setRootCount(int rootCount)
           
 void setRootList(unot.NodeList list)
           
 java.lang.String toString()
          Retrieves a String representation of the object.
 java.lang.String writeToString()
          Retrieve a tree like String representation of the object.
 
クラス java.lang.Object から継承したメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

_freePatId

private static int _freePatId
Pattern の通し番号 ID


docSet

static unot.DocSet docSet
木の清書出力用のdocsetオブジェクト


reader

static unot.PatternReader reader
木の清書入力手続き


writer

static unot.PatternWriter writer
木の清書出力手続き


INFTY_INDEX

public static final int INFTY_INDEX
Infinity Node への仮想インデックス. left または right にこの値があれば,そこに子供がいないことを表す.

関連項目:
定数フィールド値

code

protected unot.DLpair[] code
(depth, label) 対の列


right

protected int[] right
code における右木への添字インデックス値の配列


id

protected int id
パターンの通し番号. 新しいパターンの生成ごとに一つずつ増加させられる.


rootList

protected unot.NodeList rootList
根出現となるノードのリスト.オプション


rootCount

protected int rootCount
根出現となるノードのリスト.オプション

コンストラクタの詳細

Pattern

public Pattern()
Creates a new Pattern instance.


Pattern

public Pattern(int rootLabel)
Returns a Pattern object that has only root node.

パラメータ:
rootLabel - an int value

Pattern

public Pattern(unot.DLpair[] code,
               int[] right)
Creates a new Pattern instance.

パラメータ:
code - a DLpair[] value
right - an int[] value
メソッドの詳細

getPatId

static int getPatId()

setPatternReader

public static void setPatternReader(unot.PatternReader reader)
パターン入力ルーチンを設定する.


setPatternWriter

public static void setPatternWriter(unot.PatternWriter writer)
パターン出力ルーチンを設定する.


getPatternWriter

public static unot.PatternWriter getPatternWriter()
パターン出力ルーチンを返す.


getCodeSize

public int getCodeSize()
Get the code size (= the number of nodes).

戻り値:
an size of the pattern

getNodeAt

public unot.DLpair getNodeAt(int i)
Get the depth-label pair for the i-th node.

戻り値:
a DLpair (depth, label)

getRight

public int[] getRight()

getRootList

public unot.NodeList getRootList()

getRootCount

public int getRootCount()

setRootCount

public void setRootCount(int rootCount)

setRootList

public void setRootList(unot.NodeList list)

getId

public int getId()

setId

public void setId(int id)

getTopDepth

public int getTopDepth()
Get the top depth of the rightmost branch.

戻り値:
an int value

getTopIndex

public int getTopIndex()
Gets the top index of the `code' array of this object.

戻り値:
an int value

getNodeIndex

public int getNodeIndex(int depth)
Gets the index of the node on the `code' array of this object.

パラメータ:
depth - an int value
戻り値:
an int value

getNodeLabel

public int getNodeLabel(int depth)
Gets the label of the rightmost branch node at the depth.

パラメータ:
depth - an int value
戻り値:
an int value

getRightIndex

public int getRightIndex(int depth)
Gets the index of the depth in the rightmost branch.

パラメータ:
depth - an int value
戻り値:
an int value

isInftyNode

public boolean isInftyNode(int depth)
Distinguish whether the depth node is Infinity Node or not.

パラメータ:
depth - an int value
戻り値:
a boolean value

rightmostExpand

public unot.Pattern rightmostExpand(unot.Pattern oldPattern,
                                    unot.DLpair newNode,
                                    int succCopyDepth)
Returns a Pattern which is expanded with the Rightmost Expantion.

パラメータ:
oldPattern - an Pattern value
newNode - a DLpair value
succCopyDepth - an int value
戻り値:
an Pattern value

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a cloned object.

オーバーライド:
クラス java.lang.Object 内の clone
戻り値:
an Object value
例外:
java.lang.CloneNotSupportedException - if an error occurs

toString

public java.lang.String toString()
Retrieves a String representation of the object.

オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
a String representation of this object.
関連項目:
Object.toString()

writeToString

public java.lang.String writeToString()
Retrieve a tree like String representation of the object.

戻り値:
a String value