Calculator. java:
/*** @ Title: Calculator. java * @ Package: com. you. model * @ Description: The value class for encapsulation calculation * @ author: Youhaidong (Youhaidong) * @ date: 10:40:34 * @ version V1.0 */package com. you. model; import java. io. serializable;/*** class Function Description * class modifier modification date * modification Description *Title: Calculator. java
*Description: Personal Development of youhaidong
*Copyright: Copyright (c) 2013
* @ Author: You Haidong * @ date: 10:40:34 * @ version V1.0 */public class Calculator implements Serializable {/*** @ Fields serialVersionUID: serialize */private static final long serialVersionUID = 1L;/*** operand 1 */private double operandOne;/*** operand 2 */private double operandTwo; /*** operation result */private double result = 0.0;/*** operator */private String operator;/*** addition */public double addition () {result = operandOne + operandTwo; return result;}/*** subtraction */public double subtraction () {result = operandOne-operandTwo; return result ;} /*** multiplication */public double multiplication () {result = operandOne * operandTwo; return result;}/*** division */public double division () {result = operandOne/operandTwo; return result;}/*** @ return the operandOne */public double getOperandOne () {return operandOne ;} /*** @ param operandOne the operandOne to set */public void setOperandOne (double operandOne) {this. operandOne = operandOne;}/*** @ return the operandTwo */public double getOperandTwo () {return operandTwo ;} /*** @ param operandTwo the operandTwo to set */public void setOperandTwo (double operandTwo) {this. operandTwo = operandTwo;}/*** @ return the result */public double getResult () {return result ;} /*** @ param result the result to set */public void setResult (double result) {this. result = result;}/*** @ return the operator */public String getOperator () {return operator ;} /*** @ param operator the operator to set */public void setOperator (String operator) {this. operator = operator ;}}