Poging tot het flexibel laten werken van devices met features. Zou moeten werken via een enum, maar lukt nog niet.

This commit is contained in:
2011-02-02 13:00:33 +00:00
parent 35defa2593
commit 1e53c39bc2
8 changed files with 380 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
package pm.device;
import java.util.ArrayList;
import pm.device.feature.Feature;
public abstract class Device {
protected ArrayList<Feature> featureList;
protected Device() {
featureList = new ArrayList<Feature>();
}
public void addFeature(Feature feature) {
if (!hasFeature(feature)) {
if (this instanceof feature.getClass()) {
}
featureList.add(feature);
}
}
public void removeFeature(Feature feature) {
featureList.remove(feature);
}
public boolean hasFeature(Feature feature) {
return featureList.contains(feature);
}
}