@Override public void add(int index, E element) { checkForComod(); super.add(index,element); }
pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key);
@Override public boolean add(E o) { checkForComod(); return super.add(o); }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _size = 0; _modCount = 0; _cursors = new ArrayList<WeakReference<Cursor>>(); _head = new Listable<E>(null,null,null); int size = in.readInt(); for (int i=0;i<size;i++) { this.add((E)in.readObject()); } }
/** * Registers a key for pool control. * * If <code>populateImmediately</code> is <code>true</code> and * <code>minIdle > 0,</code> the pool under the given key will be * populated immediately with <code>minIdle</code> idle instances. * * @param key - The key to register for pool control. * @param populateImmediately - If this is <code>true</code>, the pool * will be populated immediately. * @since Pool 1.3 */ public synchronized void preparePool(K key, boolean populateImmediately) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key,pool); _poolList.add(key); } if (populateImmediately) { try { // Create the pooled objects ensureMinIdle(key); } catch (Exception e) { //Do nothing } } }
/** * Inserts the specified element at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index index at which the specified element is to be inserted. * @param element element to be inserted. * * @throws ClassCastException if the class of the specified element * prevents it from being added to this list. * @throws IllegalArgumentException if some aspect of the specified * element prevents it from being added to this list. * @throws IndexOutOfBoundsException if the index is out of range * (index < 0 || index > size()). */ public void add(int index, E element) { if(index == _size) { add(element); } else { if(index < 0 || index > _size) { throw new IndexOutOfBoundsException(String.valueOf(index) + " < 0 or " + String.valueOf(index) + " > " + _size); } Listable<E> succ = (isEmpty() ? null : getListableAt(index)); Listable<E> pred = (null == succ ? null : succ.prev()); insertListable(pred,succ,element); } }
/** * {@inheritDoc} * <p>Activation of this method decrements the active count associated with the given keyed pool * and attempts to destroy <code>obj.</code></p> * * @param key pool key * @param obj instance to invalidate * @throws Exception if an exception occurs destroying the object */ @Override public void invalidateObject(K key, V obj) throws Exception { try { _factory.destroyObject(key, obj); } finally { synchronized (this) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key); } pool.decrementActiveCount(); } allocate(); // _totalActive has changed } }
pool = new ObjectQueue(); _poolMap.put(latch.getkey(), pool); _poolList.add(latch.getkey());
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _size = 0; _modCount = 0; _cursors = new ArrayList(); _head = new Listable(null,null,null); int size = in.readInt(); for (int i=0;i<size;i++) { this.add(in.readObject()); } }
@Override public void add(int index, E element) { checkForComod(); super.add(index,element); }
@Override public void add(int index, E element) { checkForComod(); super.add(index,element); }
@Override public boolean add(E o) { checkForComod(); return super.add(o); }
@Override public boolean add(E o) { checkForComod(); return super.add(o); }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _size = 0; _modCount = 0; _cursors = new ArrayList<WeakReference<Cursor>>(); _head = new Listable<E>(null,null,null); int size = in.readInt(); for (int i=0;i<size;i++) { this.add((E)in.readObject()); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _size = 0; _modCount = 0; _cursors = new ArrayList(); _head = new Listable(null,null,null); int size = in.readInt(); for (int i=0;i<size;i++) { this.add(in.readObject()); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _size = 0; _modCount = 0; _cursors = new ArrayList<WeakReference<Cursor>>(); _head = new Listable<E>(null,null,null); int size = in.readInt(); for (int i=0;i<size;i++) { this.add((E)in.readObject()); } }
public boolean add(Object o) { checkForComod(); return super.add(o); }
public void add(int index, Object element) { checkForComod(); super.add(index,element); }
public boolean add(Object o) { checkForComod(); return super.add(o); }
public void add(int index, Object element) { checkForComod(); super.add(index,element); }