30 |
* @author Grigor Iliev |
* @author Grigor Iliev |
31 |
*/ |
*/ |
32 |
public abstract class AbstractDevice implements Device { |
public abstract class AbstractDevice implements Device { |
33 |
|
private int id = -1; |
34 |
private String driver = null; |
private String driver = null; |
35 |
private boolean active = false; |
private boolean active = false; |
36 |
|
|
37 |
private final Vector<Parameter> prmList = new Vector<Parameter>(); |
private final Vector<Parameter> prmList = new Vector<Parameter>(); |
38 |
|
|
39 |
|
/** Creates new instance of <code>AbstractDevice</code> */ |
40 |
public |
public |
41 |
AbstractDevice() { |
AbstractDevice() { |
42 |
} |
} |
43 |
|
|
44 |
/** |
/** |
45 |
|
* Gets the numerical ID of this device. |
46 |
|
* @return The numerical ID of this device or -1 if the device number is not set. |
47 |
|
*/ |
48 |
|
public int |
49 |
|
getDeviceID() { return id; } |
50 |
|
|
51 |
|
/** |
52 |
|
* Sets the numerical ID of this device. |
53 |
|
* @param id The new numerical ID of this device. |
54 |
|
*/ |
55 |
|
public void |
56 |
|
setDeviceID(int id) { this.id = id; } |
57 |
|
|
58 |
|
/** |
59 |
* Gets the driver name used by this device. |
* Gets the driver name used by this device. |
60 |
* @return The driver name used by this device. |
* @return The driver name used by this device. |
61 |
*/ |
*/ |
105 |
*/ |
*/ |
106 |
public boolean |
public boolean |
107 |
hasAdditionalParameters() { return !prmList.isEmpty(); } |
hasAdditionalParameters() { return !prmList.isEmpty(); } |
108 |
|
|
109 |
|
/** |
110 |
|
* Returns the numerical ID of the device. |
111 |
|
* @return The numerical ID of the device. |
112 |
|
*/ |
113 |
|
public String |
114 |
|
toString() { return String.valueOf(getDeviceID()); } |
115 |
} |
} |