org.mklab.tool.control.system.graph
クラス SparceStringMatrix

java.lang.Object
  上位を拡張 org.mklab.nfc.matrix.AbstractGrid<SparceStringMatrix>
      上位を拡張 org.mklab.tool.control.system.graph.SparceStringMatrix
すべての実装されたインタフェース:
Serializable, Cloneable, Grid

public class SparceStringMatrix
extends AbstractGrid<SparceStringMatrix>

文字列を成分とする疎な行列を表現するクラスです。

バージョン:
$Revision: 1.10 $, 2006/11/03
作成者:
Yusuke Tsutsui
関連項目:
直列化された形式

コンストラクタの概要
SparceStringMatrix()
          0x0の文字列行列を生成します。
SparceStringMatrix(int rowSize, int columnSize)
          コンストラクター
SparceStringMatrix(String[] elements)
          elementsで与えられた成分をもつ行ベクトルを生成します。
SparceStringMatrix(String[][] elements)
          elementsで与えられた成分をもつ文字列行列を生成します。
 
メソッドの概要
 SparceStringMatrix clone()
          Object#clone()
 boolean equals(Object opponent)
           
 void exchangeColumn(int column1, int column2)
          column1列とcolumn2列を入れ替えます。
 void exchangeRow(int row1, int row2)
          row1行とrow2行を入れ替えます。
 SparceStringMatrix exchangeRowAndColumn(int n1, int n2)
          行n1と行n2、列n1と列n2を同時に入れ替えた行列を返します。
 int getColumnElementCount(int column)
          指定した列に存在する空文字列でない成分の数を返します。
 String getElement(int row, int column)
          rowcolumn列の成分を返します。
 int getRowElementCount(int row)
          指定した行に存在する空文字列でない成分の数を返します。
 boolean hasElement(int row, int column)
          指定した位置に値が入っているか判定します。
 int hashCode()
           
 boolean isZero()
          零行列(全ての成分がデフォルトの初期値)であるか判定します。
 void printElements(Writer output)
          ライターに成分を出力します。
 void printElements(Writer output, int maxColumnSize)
          ライターに成分を出力します。
 void removeColumnVectors(int columnMin, int columnMax)
          columnMin列からcolumnMax列までを削除します。
 void removeColumnVectors(IntMatrix columnIndex)
          columnIndexで指定された列を削除します。
 SparceStringMatrix removeNode(int node)
          指定されたノードを削除した文字列行列を返します。
 SparceStringMatrix removeRowAndColumn(int n)
          指定された行と列を削除した文字列行列を返します。
 void removeRowVectors(int rowMin, int rowMax)
          rowMin行からrowMax行までを削除します。
 void removeRowVectors(IntMatrix rowIndex)
          rowIndexで指定された行を削除します。
 void setElement(int row, int column, String value)
          指定した位置に値を設定します。
 
クラス org.mklab.nfc.matrix.AbstractGrid から継承されたメソッド
count, getColumnSize, getDefaultElementAlignment, getDefaultElementFormat, getElementAlignment, getElementFormat, getGridClassName, getPrintingElementsString, getPrintingString, getRowSize, hasSameColumnSize, hasSameRowSize, isEmpty, isSameSize, isSquare, length, print, print, print, removeColumnVector, removeRowVector, setColumnSize, setDefaultElementAlignment, setDefaultElementFormat, setElementAlignment, setElementFormat, setRowSize, toString
 
クラス java.lang.Object から継承されたメソッド
finalize, getClass, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

SparceStringMatrix

public SparceStringMatrix()
0x0の文字列行列を生成します。


SparceStringMatrix

public SparceStringMatrix(String[] elements)
elementsで与えられた成分をもつ行ベクトルを生成します。

パラメータ:
elements - Stringの配列

SparceStringMatrix

public SparceStringMatrix(int rowSize,
                          int columnSize)
コンストラクター

パラメータ:
rowSize - 行の数
columnSize - 列の数

SparceStringMatrix

public SparceStringMatrix(String[][] elements)
elementsで与えられた成分をもつ文字列行列を生成します。

パラメータ:
elements - Stringの2次元配列
メソッドの詳細

getElement

public String getElement(int row,
                         int column)
rowcolumn列の成分を返します。

パラメータ:
row - 行番号
column - 列番号
戻り値:
(row,column)成分

hasElement

public boolean hasElement(int row,
                          int column)
指定した位置に値が入っているか判定します。

パラメータ:
row - 行番号
column - 列番号
戻り値:
指定した位置に値が入っていればtrue、入っていなければfalse

setElement

public void setElement(int row,
                       int column,
                       String value)
指定した位置に値を設定します。

パラメータ:
row - 行番号
column - 列番号
value - (row,column)に設定する String

printElements

public void printElements(Writer output)
インタフェース Grid の記述:
ライターに成分を出力します。

パラメータ:
output - ライター
関連項目:
Grid.printElements(java.io.Writer)

printElements

public void printElements(Writer output,
                          int maxColumnSize)
インタフェース Grid の記述:
ライターに成分を出力します。

パラメータ:
output - ライター
maxColumnSize - 1行の出力する列の最大数
関連項目:
Grid.printElements(java.io.Writer, int)

removeNode

public SparceStringMatrix removeNode(int node)
指定されたノードを削除した文字列行列を返します。

パラメータ:
node - 削除対象のノード
戻り値:
削除対象ノードを削除した文字列行列

removeRowAndColumn

public SparceStringMatrix removeRowAndColumn(int n)
指定された行と列を削除した文字列行列を返します。

パラメータ:
n - 削除対象の行番号、列番号
戻り値:
指定された行と列を削除した文字列行列

exchangeRow

public void exchangeRow(int row1,
                        int row2)
インタフェース Grid の記述:
row1行とrow2行を入れ替えます。

パラメータ:
row1 - 行番号1
row2 - 行番号1
関連項目:
Grid.exchangeRow(int, int)

exchangeColumn

public void exchangeColumn(int column1,
                           int column2)
インタフェース Grid の記述:
column1列とcolumn2列を入れ替えます。

パラメータ:
column1 - 列番号1
column2 - 列番号2
関連項目:
Grid.exchangeColumn(int, int)

exchangeRowAndColumn

public SparceStringMatrix exchangeRowAndColumn(int n1,
                                               int n2)
行n1と行n2、列n1と列n2を同時に入れ替えた行列を返します。

パラメータ:
n1 - 行番号1、列番号1
n2 - 行番号2、列番号2
戻り値:
行1と行2、列1と列2を入れ替えた文字行列

getRowElementCount

public int getRowElementCount(int row)
指定した行に存在する空文字列でない成分の数を返します。

パラメータ:
row - 行番号
戻り値:
指定した行に存在する空文字列でない成分の数

getColumnElementCount

public int getColumnElementCount(int column)
指定した列に存在する空文字列でない成分の数を返します。

パラメータ:
column - 列番号
戻り値:
指定した列に存在する空文字列でない成分の数

equals

public boolean equals(Object opponent)
オーバーライド:
クラス Object 内の equals
関連項目:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
オーバーライド:
クラス AbstractGrid<SparceStringMatrix> 内の hashCode
関連項目:
Object.hashCode()

clone

public SparceStringMatrix clone()
クラス AbstractGrid の記述:
Object#clone()

定義:
インタフェース Grid 内の clone
オーバーライド:
クラス AbstractGrid<SparceStringMatrix> 内の clone
戻り値:
複製(クローン)
関連項目:
AbstractGrid.clone()

isZero

public boolean isZero()
インタフェース Grid の記述:
零行列(全ての成分がデフォルトの初期値)であるか判定します。

戻り値:
零行列(全ての成分がデフォルトの初期値)ならばtrue、そうでなければfalse
関連項目:
Grid.isZero()

removeColumnVectors

public void removeColumnVectors(int columnMin,
                                int columnMax)
インタフェース Grid の記述:
columnMin列からcolumnMax列までを削除します。

パラメータ:
columnMin - 列の始まり
columnMax - 列の終わり
関連項目:
Grid.removeColumnVectors(int, int)

removeColumnVectors

public void removeColumnVectors(IntMatrix columnIndex)
インタフェース Grid の記述:
columnIndexで指定された列を削除します。

パラメータ:
columnIndex - 列指定ベクトル
関連項目:
Grid.removeColumnVectors(org.mklab.nfc.matrix.IntMatrix)

removeRowVectors

public void removeRowVectors(int rowMin,
                             int rowMax)
インタフェース Grid の記述:
rowMin行からrowMax行までを削除します。

パラメータ:
rowMin - 行の始まり
rowMax - 行の終わり
関連項目:
Grid.removeRowVectors(int, int)

removeRowVectors

public void removeRowVectors(IntMatrix rowIndex)
インタフェース Grid の記述:
rowIndexで指定された行を削除します。

パラメータ:
rowIndex - 行指定ベクトル
関連項目:
Grid.removeRowVectors(org.mklab.nfc.matrix.IntMatrix)