This topic applies to Java only
01/* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com */ 02
03
package com.db4odoc.tpbuildtime; 04
05
public class SensorPanel { 06
07
private Object _sensor; 08
09
private SensorPanel _next; 10
11
public SensorPanel() { 12
// default constructor for instantiation 13
} 14
// end SensorPanel 15
16
public SensorPanel(int value) { 17
_sensor = new Integer(value); 18
} 19
// end SensorPanel 20
21
public SensorPanel getNext() { 22
return _next; 23
} 24
// end getNext 25
26
public Object getSensor() { 27
return _sensor; 28
} 29
// end getSensor 30
31
public void setSensor(Object sensor) { 32
_sensor = sensor; 33
} 34
// end setSensor 35
36
public SensorPanel createList(int length) { 37
return createList(length, 1); 38
} 39
// end createList 40
41
public SensorPanel createList(int length, int first) { 42
int val = first; 43
SensorPanel root = newElement(first); 44
SensorPanel list = root; 45
while (--length > 0) { 46
list._next = newElement(++val); 47
list = list._next; 48
} 49
return root; 50
} 51
// end createList 52
53
protected SensorPanel newElement(int value) { 54
return new SensorPanel(value); 55
} 56
// end newElement 57
58
public String toString() { 59
return "Sensor #" + getSensor(); 60
} 61
// end toString 62
}