KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4odoc > f1 > utility > SensorPanel


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com */
2
3 package com.db4odoc.f1.utility;
4
5
6 public class SensorPanel {
7
8     public Object JavaDoc sensor;
9     public SensorPanel next;
10     
11     public SensorPanel(){
12         // default constructor for instantiation
13
}
14     
15     public SensorPanel(int value){
16         sensor = new Integer JavaDoc(value);
17     }
18     
19     public SensorPanel createList(int length){
20         return createList(length, 1);
21     }
22     
23     public SensorPanel createList(int length, int first){
24         int val = first;
25         SensorPanel root = newElement(first);
26         SensorPanel list = root;
27         while(--length > 0){
28             list.next = newElement(++ val);
29             list = list.next;
30         }
31         return root;
32     }
33     
34     protected SensorPanel newElement(int value){
35         return new SensorPanel(value);
36     }
37         
38       public String JavaDoc toString() {
39             return "Sensor #" + sensor ;
40         }
41 }
42
Popular Tags