KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > piagetproject > property > DoubleProperty


1 /*
2  * DoubleProperty.java
3  *
4  * Created on July 27, 2005, 4:27 PM
5  *
6  * To change this template, choose Tools | Options and locate the template under
7  * the Source Creation and Management node. Right-click the template and choose
8  * Open. You can then make changes to the template in the Source Editor.
9  */

10
11 package org.netbeans.modules.piagetproject.property;
12
13 /**
14  *
15  * @author loicsegapelli
16  */

17 public class DoubleProperty extends Property{
18     
19     double value;
20     
21     /** Creates a new instance of DoubleProperty */
22     public DoubleProperty(String JavaDoc key, String JavaDoc name, String JavaDoc value, String JavaDoc table) {
23         super(key, table, name);
24         this.value = Double.parseDouble((String JavaDoc)value);
25     }
26
27     public Object JavaDoc getValue(int counter) {
28         return Double.toString(value/counter);
29     }
30
31     protected void combineProperties(String JavaDoc key, String JavaDoc value) {
32         double d = Double.parseDouble(value);
33         this.value += d;
34     }
35     
36 }
37
Popular Tags