1 2 3 package com.db4odoc.f1.utility; 4 5 6 public class SensorPanel { 7 8 public Object sensor; 9 public SensorPanel next; 10 11 public SensorPanel(){ 12 } 14 15 public SensorPanel(int value){ 16 sensor = new Integer (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 toString() { 39 return "Sensor #" + sensor ; 40 } 41 } 42 | Popular Tags |