/** {@inheritDoc} */ @Override public boolean addAll(Collection<? extends E> collection) { return addAll(size(), collection); }
/** {@inheritDoc} */ @Override public boolean addAll(Collection<? extends E> collection) { return addAll(size(), collection); }
/** {@inheritDoc} */ @Override public boolean addAll(Collection<? extends E> collection) { return addAll(size(), collection); }
@Benchmark @Warmup(iterations = 3) @Measurement(iterations = 10) @Fork(3) public void testRemove() { while (list.size() < 500) { list.add(list.size()); } while (list.size() < 1000) { list.add(0, list.size()); } while (list.size() > 500) { list.remove(0); } while (list.size() > 0) { list.remove(list.size() - 1); } } }
/** {@inheritDoc} */ @Override public boolean add(E element) { // create the change event updates.beginEvent(); updates.elementInserted(size(), element); // do the actual add boolean result = data.add(element); // fire the event updates.commitEvent(); return result; }
/** {@inheritDoc} */ @Override public boolean add(E element) { // create the change event updates.beginEvent(); updates.elementInserted(size(), element); // do the actual add boolean result = data.add(element); // fire the event updates.commitEvent(); return result; }
/** {@inheritDoc} */ @Override public boolean add(E element) { // create the change event updates.beginEvent(); updates.elementInserted(size(), element); // do the actual add boolean result = data.add(element); // fire the event updates.commitEvent(); return result; }
/** {@inheritDoc} */ @Override public void clear() { // don't do a clear on an empty set if(isEmpty()) return; // create the change event updates.beginEvent(); for(int i = 0, size = size(); i < size; i++) { updates.elementDeleted(0, get(i)); } // do the actual clear data.clear(); // fire the event updates.commitEvent(); }
/** {@inheritDoc} */ @Override public void clear() { // don't do a clear on an empty set if(isEmpty()) return; // create the change event updates.beginEvent(); for(int i = 0, size = size(); i < size; i++) { updates.elementDeleted(0, get(i)); } // do the actual clear data.clear(); // fire the event updates.commitEvent(); }
/** {@inheritDoc} */ @Override public void clear() { // don't do a clear on an empty set if(isEmpty()) return; // create the change event updates.beginEvent(); for(int i = 0, size = size(); i < size; i++) { updates.elementDeleted(0, get(i)); } // do the actual clear data.clear(); // fire the event updates.commitEvent(); }