01: package vicazh.hyperpool;
02:
03: /**
04: * This class is the superclass of all selectors
05: *
06: * @author Victor Zhigunov
07: * @version 0.4.0
08: */
09: abstract public class Selector extends Element implements SelectorMBean {
10: private GroupMBean group;
11:
12: public void setGroup(GroupMBean group) {
13: this .group = group;
14: }
15:
16: public GroupMBean getGroup() {
17: return group;
18: }
19:
20: private int def;
21:
22: public void setDef(int def) {
23: this .def = def;
24: }
25:
26: public int getDef() {
27: return def;
28: }
29:
30: public void added(int index) {
31: if (def >= index)
32: def++;
33: }
34:
35: public void removed(int index) {
36: if (def > index)
37: def--;
38: }
39:
40: public void setAttribute(String name, Object value)
41: throws Exception {
42: if (name.equals(SelectorMBean.DEF))
43: setDef((Integer) value);
44: super.setAttribute(name, value);
45: }
46: }
|