/** * Adds all layers from the input collection that are not already present in this map content. * * @param layers layers to add (may be {@code null} or empty) * @return the number of layers added */ public int addLayers(Collection<? extends Layer> layers) { monitor.writeLock().lock(); try { if (layers == null || layers.isEmpty()) { return 0; } return layerList.addAllAbsent(layers); } finally { monitor.writeLock().unlock(); } }
/** * Adds all layers from the input collection that are not already present * in this map content. * * @param layers layers to add (may be {@code null} or empty) * @return the number of layers added */ public int addLayers(Collection<? extends Layer> layers) { monitor.writeLock().lock(); try { if (layers == null || layers.isEmpty()) { return 0; } return layerList.addAllAbsent(layers); } finally { monitor.writeLock().unlock(); } }
/** * Adds all layers from the input collection that are not already * present in this list. Equivalent to {@code addAllAbsent(layers) > 0}. * * @param layers candidate layers to add * @return {@code true} is any layers were added; {@code false} otherwise */ @Override public boolean addAll(Collection<? extends Layer> layers) { return addAllAbsent(layers) > 0; }
/** * Adds all layers from the input collection that are not already present in this list. * Equivalent to {@code addAllAbsent(layers) > 0}. * * @param layers candidate layers to add * @return {@code true} is any layers were added; {@code false} otherwise */ @Override public boolean addAll(Collection<? extends Layer> layers) { return addAllAbsent(layers) > 0; }