Beispiel #1
0
 @Override
 protected Vital doSet(int index, Vital element) {
   Vital removed = vitals.set(index, element);
   removed.removeListener(this);
   elementObserver.detachListener(removed);
   elementObserver.attachListener(element);
   removed.addListener(this);
   numericList.forEach((fx) -> addNumeric(fx));
   return removed;
 }
Beispiel #2
0
 @Override
 protected void doAdd(int index, Vital element) {
   element.addListener(this);
   elementObserver.attachListener(element);
   vitals.add(index, element);
   numericList.forEach((fx) -> addNumeric(fx));
 }
Beispiel #3
0
 @Override
 protected Vital doRemove(int index) {
   Vital v = vitals.remove(index);
   elementObserver.detachListener(v);
   v.removeListener(this);
   if (null != v) {
     v.destroy();
   }
   return v;
 }
Beispiel #4
0
 @Override
 public void clear() {
   if (elementObserver != null) {
     final int sz = size();
     for (int i = 0; i < sz; ++i) {
       get(i).removeListener(this);
       elementObserver.detachListener(get(i));
     }
   }
   if (hasListeners()) {
     beginChange();
     nextRemove(0, this);
   }
   vitals.clear();
   ++modCount;
   if (hasListeners()) {
     endChange();
   }
 }