@Override public int addAllAbsent(Collection<? extends T> c) { int added = super.addAllAbsent(c); if (added > 0) { // drop the transient set, will be rebuilt when/if needed synchronized(this) { knownGroupNamesInList = null; } } return added; }
/** * Adds all of the elements in the specified collection to this set if * they're not already present. If the specified collection is also a * set, the {@code addAll} operation effectively modifies this set so * that its value is the <i>union</i> of the two sets. The behavior of * this operation is undefined if the specified collection is modified * while the operation is in progress. * * @param c collection containing elements to be added to this set * @return {@code true} if this set changed as a result of the call * @throws NullPointerException if the specified collection is null * @see #add(Object) */ public boolean addAll(Collection<? extends E> c) { return al.addAllAbsent(c) > 0; }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
/** * Append the element if not present. * * @return the number of elements added */ public int addAllAbsent(Collection<IpFilterRule> c) { if (c == null) { throw new NullPointerException("Collection can not be null"); } return ipFilterRuleList.addAllAbsent(c); }
/** * Adds all layers from the input collection that are not already present in this list. * * @param layers candidate layers to add * @return the number of layers added */ @Override public int addAllAbsent(Collection<? extends Layer> layers) { int start = size(); int added = super.addAllAbsent(layers); if (added > 0) { if (layerListener != null) { for (int i = start; i < size(); i++) { get(i).addMapLayerListener(layerListener); } } checkViewportCRS(); fireLayerAdded(null, start, size() - 1); } return added; }
@Override public int addAllAbsent(Collection<? extends T> c) { int added = super.addAllAbsent(c); if (added > 0) { // drop the transient set, will be rebuilt when/if needed synchronized(this) { knownGroupNamesInList = null; } } return added; }
@Override public int addAllAbsent(Collection<? extends T> c) { int i = super.addAllAbsent(c); if (i > 0) { modCount.incrementAndGet(); } return i; }
@Override public int addAllAbsent(Collection<? extends T> c) { int i = super.addAllAbsent(c); if (i > 0) { modCount.incrementAndGet(); } return i; }
/** * Append the element if not present. * * @return the number of elements added */ public int addAllAbsent(Collection<IpFilterRule> c) { if (c == null) { throw new NullPointerException("Collection can not be null"); } return ipFilterRuleList.addAllAbsent(c); }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
@Override public int addAllAbsent(Collection<? extends T> c) { int i = super.addAllAbsent(c); if (i > 0) { modCount.incrementAndGet(); } return i; }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
/** * Creates a set containing all of the elements of the specified * collection. * * @param c the collection of elements to initially contain * @throws NullPointerException if the specified collection is null */ public CopyOnWriteArraySet(Collection<? extends E> c) { al = new CopyOnWriteArrayList<E>(); al.addAllAbsent(c); }
@Override public int addAllAbsent(Collection<? extends T> c) { int i = super.addAllAbsent(c); if (i > 0) { modCount.incrementAndGet(); } return i; }
@Override public int addAllAbsent(Collection<? extends T> c) { int i = super.addAllAbsent(c); if (i > 0) { modCount.incrementAndGet(); } return i; }
public void setListeners(Collection<ListenerInterfaceType> listeners) { this.listeners.retainAll(listeners); this.listeners.addAllAbsent(listeners); }