org.mklab.nfc.matx
クラス MatxList

java.lang.Object
  上位を拡張 org.mklab.nfc.matx.MatxList
すべての実装されたインタフェース:
Cloneable, MatxObject

public class MatxList
extends Object
implements Cloneable, MatxObject

MaTXのList型を実装したクラスです。

バージョン:
$Revision: 1.22 $
作成者:
matsuki

コンストラクタの概要
MatxList()
          空のインスタンスを生成します。
MatxList(int count)
          成分がcount個のインスタンスを生成します。
MatxList(List<E> valueList)
          コンストラクター
MatxList(Object[] values)
          コンストラクター
 
メソッドの概要
 void add(boolean value)
          valueをリストの最後に追加します。
 void add(double value)
          valueをリストの最後に追加します。
 void add(DoubleComplexNumber value)
          valueをリストの最後に追加します。
 void add(int value)
          valueをリストの最後に追加します。
 void add(Matrix value)
          valueをリストの最後に追加します。
 void add(MatxList value)
          valueをリストの最後に追加します。
 void add(Polynomial value)
          valueをリストの最後に追加します。
 void add(RationalPolynomial value)
          valueをリストの最後に追加します。
 void add(String value)
          valueをリストの最後に追加します。
 MatxList append(MatxList value)
          valueをリストに結合します。
 Object clone()
          Object#clone()
 BooleanMatrix compareElementWise(boolean opponent, String operator)
          各要素とopponentをoperatorで指定された演算子 (".==", ".!
 BooleanMatrix compareElementWise(DoubleComplexNumber opponent, String operator)
          各要素とopponentをoperatorで指定された演算子 (".==", ".!
 BooleanMatrix compareElementWise(double opponent, String operator)
          各要素とopponentをoperatorで指定された演算子 (". <", ". <=", ".>", ".>=", ".==", ".!
 BooleanMatrix compareElementWise(int opponent, String operator)
          各要素とvalをoperatorで指定された演算子 (". <", ". <=", ".>", ".>=", ".==", ".!
 BooleanMatrix compareElementWise(Matrix opponent, String operator)
          各要素とopponentをoperatorで指定された演算子 (".==", ".!
 BooleanMatrix compareElementWise(MatxList opponent, String operator)
          aと要素毎にoperatorで指定された演算子 (". <", ". <=", ".>", ".>=", ".==", ".!
 BooleanMatrix compareElementWise(Polynomial opponent, String operator)
          各要素とopponentをoperatorで指定された演算子 (".==", ".!
 BooleanMatrix compareElementWise(RationalPolynomial opponent, String operator)
          各要素とopponentをoperatorで指定された演算子 (".==", ".!
 BooleanMatrix compareElementWise(String opponent, String operator)
          各要素とopponentをoperatorで指定された演算子 (".==", ".!
 boolean equals(Object opponent)
           
 boolean getBoolean(int index)
          要素をboolean型で取り出す。
 DoubleComplexNumber getComplex(int index)
          要素を Complex 型で取り出す。
static String getDefaultFormat()
          デフォルト出力フォーマットを返します。
 double getDouble(int index)
          要素をdouble型で取り出す。
 String getFormat()
          出力フォーマットを返します。
 int getInt(int index)
          要素をint型で取り出す。
 MatxList getList(int index)
          要素を List 型で取り出す。
 Matrix getMatrix(int index)
          要素を Matrix 型で取り出す。
 Scalar<?> getMatrixElement(int index)
          要素を MatrixElement 型で取り出す。
 Object getObject(int index)
          要素を Object 型で取り出す。
 Polynomial getPolynomial(int index)
          要素を Polynomial 型で取り出す。
 RationalPolynomial getRationalPolynomial(int index)
          要素を RationalPolynomial 型で取り出す。
 String getString(int index)
          要素を String 型で取り出す。
 MatxList getSubList(int from, int to)
          部分リストを返します。
 MatxList getSubList(IntMatrix index)
          部分リストを返します。
 int hashCode()
          Override hashCode.
 BooleanMatrix isSameClass(Class<?> clazz)
          成分毎にクラスが一致するものを選ぶ
 MatxList multiply(int count)
          リストの成分をnセット並べたリストを生成します。
 void print()
          ansという名前で標準出力に出力します。
 void print(String name)
          標準出力に出力します。
static MatxList readMxFormat(InputStream input)
          入力ストリームからMx形式のデータを読み込みます。
static MatxList readMxFormat(String fileName)
          指定されたMxファイルを読み込みます。
 void set(int index, boolean value)
          リストのi番目にbooleanを設定します。
 void set(int index, double value)
          リストのi番目に実数valueを設定します。
 void set(int index, DoubleComplexNumber value)
          リストのi番目に複素数valueを設定します。
 void set(int index, int value)
          リストのi番目に整数valueを設定します。
 void set(int index, Matrix value)
          リストのi番目に行列valueを設定します。
 void set(int index, MatxList value)
          リストのi番目にリストvalueを設定します。
 void set(int index, Polynomial value)
          リストのi番目に多項式valueを設定します。
 void set(int index, RationalPolynomial value)
          リストのi番目に有理多項式valueを設定します。
 void set(int index, String value)
          リストのi番目に文字列valueを設定します。
static void setDefaultFormat(String format)
          デフォルト出力フォーマットを設定します。
 void setFormat(String format)
          出力フォーマットを設定します。
 MatxList setSubList(int from, int to, MatxList ll)
          部分リストを設定します。
 MatxList setSubList(IntMatrix index, MatxList ll)
          部分リストを設定します。
 int size()
          リストのサイズを返します。
 List<Object> toList()
          Listとして値のリストを返します。
 String toMmString()
          MM形式の文字列を生成します。
 String toMmString(String valueFormat)
          MM形式の文字列を生成します。
 String toString()
           
 void writeMmFormat(String fileName, String name)
          MMファイル形式で行列データをファイルに出力します。
 void writeMmFormat(Writer output, String name, boolean withNewLine)
          MMフォーマット行列データをライターに出力します。
 void writeMxFormat(OutputStream output, String name)
          データをMX形式で出力ストリームへ出力します。
 void writeMxFormat(String fileName, String name)
          データをMX形式でファイルへ出力します。
 
クラス java.lang.Object から継承されたメソッド
finalize, getClass, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

MatxList

public MatxList()
空のインスタンスを生成します。


MatxList

public MatxList(int count)
成分がcount個のインスタンスを生成します。

パラメータ:
count - 成分の個数

MatxList

public MatxList(Object[] values)
コンストラクター

パラメータ:
values - 成分

MatxList

public MatxList(List<E> valueList)
コンストラクター

型パラメータ:
E - 成分の型
パラメータ:
valueList - 成分
メソッドの詳細

setDefaultFormat

public static void setDefaultFormat(String format)
デフォルト出力フォーマットを設定します。

パラメータ:
format - デフォルト出力フォーマット

getDefaultFormat

public static String getDefaultFormat()
デフォルト出力フォーマットを返します。

戻り値:
デフォルト出力フォーマット

setFormat

public void setFormat(String format)
出力フォーマットを設定します。

パラメータ:
format - 出力フォーマット

getFormat

public String getFormat()
出力フォーマットを返します。

戻り値:
出力フォーマット

toList

public List<Object> toList()
Listとして値のリストを返します。

戻り値:
値のリスト

equals

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

hashCode

public int hashCode()
Override hashCode.

オーバーライド:
クラス Object 内の hashCode
戻り値:
the Objects hash code.

clone

public Object clone()
Object#clone()

オーバーライド:
クラス Object 内の clone

toString

public String toString()
オーバーライド:
クラス Object 内の toString
関連項目:
Object.toString()

getBoolean

public boolean getBoolean(int index)
要素をboolean型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getInt

public int getInt(int index)
要素をint型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getDouble

public double getDouble(int index)
要素をdouble型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getComplex

public DoubleComplexNumber getComplex(int index)
要素を Complex 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getMatrixElement

public Scalar<?> getMatrixElement(int index)
要素を MatrixElement 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getString

public String getString(int index)
要素を String 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getMatrix

public Matrix getMatrix(int index)
要素を Matrix 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getPolynomial

public Polynomial getPolynomial(int index)
要素を Polynomial 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getRationalPolynomial

public RationalPolynomial getRationalPolynomial(int index)
要素を RationalPolynomial 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getList

public MatxList getList(int index)
要素を List 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getObject

public Object getObject(int index)
要素を Object 型で取り出す。

パラメータ:
index - 要素の番号(1番から始まる
戻り値:
指定された成分

getSubList

public MatxList getSubList(int from,
                           int to)
部分リストを返します。

パラメータ:
from - 下端(1番から始まる
to - 上端(1番から始まる
戻り値:
部分リスト

getSubList

public MatxList getSubList(IntMatrix index)
部分リストを返します。

パラメータ:
index - 成分の指数(1番から始まる
戻り値:
部分リスト

setSubList

public MatxList setSubList(int from,
                           int to,
                           MatxList ll)
部分リストを設定します。

パラメータ:
from - 下端(1番から始まる
to - 上端(1番から始まる
ll - 設定するリスト
戻り値:
部分リストを設定後のリスト

setSubList

public MatxList setSubList(IntMatrix index,
                           MatxList ll)
部分リストを設定します。

パラメータ:
index - 指数(1番から始まる
ll - 設定するリスト
戻り値:
部分リストを設定後のリスト

add

public void add(boolean value)
valueをリストの最後に追加します。

パラメータ:
value - 追加するboolean

add

public void add(int value)
valueをリストの最後に追加します。

パラメータ:
value - 追加する整数

add

public void add(double value)
valueをリストの最後に追加します。

パラメータ:
value - 追加する実数

add

public void add(DoubleComplexNumber value)
valueをリストの最後に追加します。

パラメータ:
value - 追加する複素数

add

public void add(String value)
valueをリストの最後に追加します。

パラメータ:
value - 追加する文字列

add

public void add(Polynomial value)
valueをリストの最後に追加します。

パラメータ:
value - 追加する多項式

add

public void add(RationalPolynomial value)
valueをリストの最後に追加します。

パラメータ:
value - 追加する有理多項式

add

public void add(Matrix value)
valueをリストの最後に追加します。

パラメータ:
value - 追加する行列

add

public void add(MatxList value)
valueをリストの最後に追加します。

パラメータ:
value - 追加するリスト

append

public MatxList append(MatxList value)
valueをリストに結合します。

パラメータ:
value - 結合するリスト
戻り値:
生成されたリスト

multiply

public MatxList multiply(int count)
リストの成分をnセット並べたリストを生成します。

パラメータ:
count - 個数
戻り値:
生成されたリスト

set

public void set(int index,
                boolean value)
リストのi番目にbooleanを設定します。

パラメータ:
index - 指数(1番から始まる
value - 整数

set

public void set(int index,
                int value)
リストのi番目に整数valueを設定します。

パラメータ:
index - 指数(1番から始まる
value - 整数

set

public void set(int index,
                double value)
リストのi番目に実数valueを設定します。

パラメータ:
index - 指数(1番から始まる
value - 実数

set

public void set(int index,
                DoubleComplexNumber value)
リストのi番目に複素数valueを設定します。

パラメータ:
index - 指数(1番から始まる
value - 複素数

set

public void set(int index,
                String value)
リストのi番目に文字列valueを設定します。

パラメータ:
index - 指数(1番から始まる
value - オブジェクト

set

public void set(int index,
                Polynomial value)
リストのi番目に多項式valueを設定します。

パラメータ:
index - 指数(1番から始まる
value - 多項式

set

public void set(int index,
                RationalPolynomial value)
リストのi番目に有理多項式valueを設定します。

パラメータ:
index - 指数(1番から始まる
value - 有理多項式

set

public void set(int index,
                Matrix value)
リストのi番目に行列valueを設定します。

パラメータ:
index - 指数(1番から始まる
value - 行列

set

public void set(int index,
                MatxList value)
リストのi番目にリストvalueを設定します。

パラメータ:
index - 指数(1番から始まる
value - リスト

compareElementWise

public BooleanMatrix compareElementWise(boolean opponent,
                                        String operator)
各要素とopponentをoperatorで指定された演算子 (".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(Matrix opponent,
                                        String operator)
各要素とopponentをoperatorで指定された演算子 (".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(RationalPolynomial opponent,
                                        String operator)
各要素とopponentをoperatorで指定された演算子 (".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(Polynomial opponent,
                                        String operator)
各要素とopponentをoperatorで指定された演算子 (".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(String opponent,
                                        String operator)
各要素とopponentをoperatorで指定された演算子 (".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(DoubleComplexNumber opponent,
                                        String operator)
各要素とopponentをoperatorで指定された演算子 (".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(double opponent,
                                        String operator)
各要素とopponentをoperatorで指定された演算子 (". <", ". <=", ".>", ".>=", ".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(int opponent,
                                        String operator)
各要素とvalをoperatorで指定された演算子 (". <", ". <=", ".>", ".>=", ".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

compareElementWise

public BooleanMatrix compareElementWise(MatxList opponent,
                                        String operator)
aと要素毎にoperatorで指定された演算子 (". <", ". <=", ".>", ".>=", ".==", ".!=")で比較し, BooleanMatrixで返します。

パラメータ:
opponent - 比較対象
operator - 比較演算子
戻り値:
各要素に比較結果が入ったBooleanMatrix

isSameClass

public BooleanMatrix isSameClass(Class<?> clazz)
成分毎にクラスが一致するものを選ぶ

パラメータ:
clazz - 比較するクラス
戻り値:
boolean行列(クラスが一致すると真)

size

public int size()
リストのサイズを返します。

戻り値:
リストのサイズ

print

public void print()
ansという名前で標準出力に出力します。


print

public void print(String name)
標準出力に出力します。

パラメータ:
name - 変数名

writeMxFormat

public void writeMxFormat(String fileName,
                          String name)
                   throws IOException
インタフェース MatxObject の記述:
データをMX形式でファイルへ出力します。

定義:
インタフェース MatxObject 内の writeMxFormat
パラメータ:
fileName - ファイル名
name - データの名前
例外:
IOException - ファイルに出力できない場合
関連項目:
MatxObject.writeMxFormat(java.lang.String, java.lang.String)

writeMxFormat

public void writeMxFormat(OutputStream output,
                          String name)
                   throws IOException
インタフェース MatxObject の記述:
データをMX形式で出力ストリームへ出力します。 outputがcloseされるまで、いくつでも出力可能です。

定義:
インタフェース MatxObject 内の writeMxFormat
パラメータ:
output - 出力ストリーム
name - データの名前
例外:
IOException - 出力ストリームに出力できない場合
関連項目:
MatxObject.writeMxFormat(java.io.OutputStream, java.lang.String)

readMxFormat

public static MatxList readMxFormat(String fileName)
                             throws IOException
指定されたMxファイルを読み込みます。

パラメータ:
fileName - 読み込むmxファイル
戻り値:
読み込んだ行列
例外:
IOException - 読み込みエラー

readMxFormat

public static MatxList readMxFormat(InputStream input)
                             throws IOException
入力ストリームからMx形式のデータを読み込みます。

パラメータ:
input - 入力ストリーム
戻り値:
読み込んだ行列
例外:
IOException - 入力ストリームから読み込めない場合

writeMmFormat

public void writeMmFormat(String fileName,
                          String name)
                   throws IOException
インタフェース MatxObject の記述:
MMファイル形式で行列データをファイルに出力します。

定義:
インタフェース MatxObject 内の writeMmFormat
パラメータ:
fileName - ファイル名
name - 名前
例外:
IOException - ファイルに出力できない場合
関連項目:
MatxObject.writeMmFormat(java.lang.String, java.lang.String)

writeMmFormat

public void writeMmFormat(Writer output,
                          String name,
                          boolean withNewLine)
                   throws IOException
インタフェース MatxObject の記述:
MMフォーマット行列データをライターに出力します。

定義:
インタフェース MatxObject 内の writeMmFormat
パラメータ:
output - ライター
name - 名前
withNewLine - セミコロンと改行コードを出力するならばtrue、そうでなければfalse
例外:
IOException - ライターに出力できない場合
関連項目:
MatxObject.writeMmFormat(java.io.Writer, java.lang.String, boolean)

toMmString

public String toMmString()
インタフェース MatxObject の記述:
MM形式の文字列を生成します。

定義:
インタフェース MatxObject 内の toMmString
戻り値:
MM形式の文字列
関連項目:
MatxObject.toMmString()

toMmString

public String toMmString(String valueFormat)
インタフェース MatxObject の記述:
MM形式の文字列を生成します。

定義:
インタフェース MatxObject 内の toMmString
パラメータ:
valueFormat - 出力フォーマット
戻り値:
MM形式の文字列
関連項目:
MatxObject.toMmString(java.lang.String)