org.mklab.nfc.rpn
クラス AbstractExpressionProcessor

java.lang.Object
  上位を拡張 org.mklab.nfc.rpn.AbstractProcessor
      上位を拡張 org.mklab.nfc.rpn.AbstractExpressionProcessor
すべての実装されたインタフェース:
ReversePolishNotationExpressionProcessor, ReversePolishNotationProcessor
直系の既知のサブクラス:
ExpressionProcessor, MaximaExpressionProcessor, TeXExpressionProcessor

public abstract class AbstractExpressionProcessor
extends AbstractProcessor
implements ReversePolishNotationExpressionProcessor

逆ポーランド記法を数式に関して評価する抽象クラスです。

バージョン:
$Revision$, 2008/09/09
作成者:
koga

コンストラクタの概要
AbstractExpressionProcessor()
           
 
メソッドの概要
 ReversePolishNotationOperand addOperation(ReversePolishNotationOperand left, ReversePolishNotationOperand right)
          2個のオペランドの和を返します。
 String getResult(ReversePolishNotationOperand operand)
          オペランドを評価した結果を返します。
 String getSignedExpression(ReversePolishNotationOperand operand)
          オペランドの符号付数式を返します。
 boolean hasCancellation()
          数値がゼロの数式を削除するか判定します。
 ReversePolishNotationOperand inverseOperation(ReversePolishNotationOperand operand)
          オペランドの逆数を返します。
 ReversePolishNotationOperand multiplyOperation(ReversePolishNotationOperand left, ReversePolishNotationOperand right)
          2個のオペランドの積を返します。
 void setCancellation(boolean hasCancellation)
          数値がゼロの数式を削除するか設定します。
 
クラス org.mklab.nfc.rpn.AbstractProcessor から継承されたメソッド
evaluate, getFormat, setFormat
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.mklab.nfc.rpn.ReversePolishNotationExpressionProcessor から継承されたメソッド
getInverseString, getLeftParentheses, getMultiplicationString, getRightParentheses
 

コンストラクタの詳細

AbstractExpressionProcessor

public AbstractExpressionProcessor()
メソッドの詳細

hasCancellation

public boolean hasCancellation()
数値がゼロの数式を削除するか判定します。

戻り値:
trueならば、数値がゼロの数式を削除します。

setCancellation

public void setCancellation(boolean hasCancellation)
数値がゼロの数式を削除するか設定します。

パラメータ:
hasCancellation - trueならば、数値がゼロの数式を削除します。

getResult

public String getResult(ReversePolishNotationOperand operand)
インタフェース ReversePolishNotationProcessor の記述:
オペランドを評価した結果を返します。

定義:
インタフェース ReversePolishNotationProcessor 内の getResult
パラメータ:
operand - 対象となるオペランド
戻り値:
オペランドを評価した結果
関連項目:
ReversePolishNotationProcessor.getResult(org.mklab.nfc.rpn.ReversePolishNotationOperand)

getSignedExpression

public String getSignedExpression(ReversePolishNotationOperand operand)
オペランドの符号付数式を返します。

パラメータ:
operand - 対象となるオペランド
戻り値:
オペランドの符号付数式

inverseOperation

public ReversePolishNotationOperand inverseOperation(ReversePolishNotationOperand operand)
インタフェース ReversePolishNotationProcessor の記述:
オペランドの逆数を返します。

定義:
インタフェース ReversePolishNotationProcessor 内の inverseOperation
パラメータ:
operand - オペランド
戻り値:
オペランドの逆数
関連項目:
ReversePolishNotationProcessor.inverseOperation(org.mklab.nfc.rpn.ReversePolishNotationOperand)

addOperation

public ReversePolishNotationOperand addOperation(ReversePolishNotationOperand left,
                                                 ReversePolishNotationOperand right)
インタフェース ReversePolishNotationProcessor の記述:
2個のオペランドの和を返します。

定義:
インタフェース ReversePolishNotationProcessor 内の addOperation
パラメータ:
left - 左オペランド
right - 左オペランド
戻り値:
2個のオペランドの和
関連項目:
ReversePolishNotationProcessor.addOperation(org.mklab.nfc.rpn.ReversePolishNotationOperand, org.mklab.nfc.rpn.ReversePolishNotationOperand)

multiplyOperation

public ReversePolishNotationOperand multiplyOperation(ReversePolishNotationOperand left,
                                                      ReversePolishNotationOperand right)
インタフェース ReversePolishNotationProcessor の記述:
2個のオペランドの積を返します。

定義:
インタフェース ReversePolishNotationProcessor 内の multiplyOperation
パラメータ:
left - オペランド
right - オペランド
戻り値:
2個のオペランドの積
関連項目:
ReversePolishNotationProcessor.multiplyOperation(org.mklab.nfc.rpn.ReversePolishNotationOperand, org.mklab.nfc.rpn.ReversePolishNotationOperand)