KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * IntProperty.java
3  *
4  * Created on July 27, 2005, 4:13 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 IntProperty extends Property{
18     
19     int value;
20     
21     public IntProperty(String JavaDoc key, String JavaDoc name, String JavaDoc value, String JavaDoc table){
22         super(key, table, name);
23         this.value = Integer.parseInt((String JavaDoc)value);
24     }
25     
26     public Object JavaDoc getValue(int counter) {
27         double d = new Integer JavaDoc(value).doubleValue();
28         return Double.toString(d/counter);
29     }
30     
31     protected void combineProperties(String JavaDoc key, String JavaDoc value) {
32         int i = Integer.parseInt(value);
33         this.value += i;
34     }
35     
36     
37     
38 }
39
Popular Tags