1 16 package org.apache.myfaces.examples.example1; 17 18 import java.io.Serializable ; 19 import java.math.BigDecimal ; 20 21 26 public class CalcForm 27 implements Serializable 28 { 29 private BigDecimal number1 = new BigDecimal (0); 30 private BigDecimal number2 = new BigDecimal (0); 31 private BigDecimal result = new BigDecimal (0); 32 33 public void add() 34 { 35 result = number1.add(number2); 36 } 37 38 public void subtract() 39 { 40 result = number1.subtract(number2); 41 } 42 43 public BigDecimal getNumber1() 44 { 45 return number1; 46 } 47 48 public void setNumber1(BigDecimal number1) 49 { 50 this.number1 = number1; 51 } 52 53 public BigDecimal getNumber2() 54 { 55 return number2; 56 } 57 58 public void setNumber2(BigDecimal number2) 59 { 60 this.number2 = number2; 61 } 62 63 public BigDecimal getResult() 64 { 65 return result; 66 } 67 68 public void setResult(BigDecimal result) 69 { 70 this.result = result; 71 } 72 73 } 74 | Popular Tags |