KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > examples > example1 > CalcForm


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.examples.example1;
17
18 import java.io.Serializable JavaDoc;
19 import java.math.BigDecimal JavaDoc;
20
21 /**
22  * DOCUMENT ME!
23  * @author Manfred Geiler
24  * @version $Revision: 1.1 $ $Date: 2005/03/24 16:47:10 $
25  */

26 public class CalcForm
27     implements Serializable JavaDoc
28 {
29     private BigDecimal JavaDoc number1 = new BigDecimal JavaDoc(0);
30     private BigDecimal JavaDoc number2 = new BigDecimal JavaDoc(0);
31     private BigDecimal JavaDoc result = new BigDecimal JavaDoc(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 JavaDoc getNumber1()
44     {
45         return number1;
46     }
47
48     public void setNumber1(BigDecimal JavaDoc number1)
49     {
50         this.number1 = number1;
51     }
52
53     public BigDecimal JavaDoc getNumber2()
54     {
55         return number2;
56     }
57
58     public void setNumber2(BigDecimal JavaDoc number2)
59     {
60         this.number2 = number2;
61     }
62
63     public BigDecimal JavaDoc getResult()
64     {
65         return result;
66     }
67
68     public void setResult(BigDecimal JavaDoc result)
69     {
70         this.result = result;
71     }
72
73 }
74
Popular Tags