com.esri.map
Class LayerList

java.lang.Object
  extended by java.util.concurrent.CopyOnWriteArrayList<Layer>
      extended by com.esri.map.LayerList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Layer>, Collection<Layer>, List<Layer>, RandomAccess

public class LayerList
extends CopyOnWriteArrayList<Layer>

See Also:
Serialized Form

Constructor Summary
LayerList()
          Instantiates a new, empty layer list.
LayerList(Collection<? extends Layer> c)
          Instantiates a new layer list with the given collection.
LayerList(Layer[] toCopyIn)
          Instantiates a new layer list with the given Layers
 
Method Summary
 void add(int index, Layer element)
          Adds the given layer to this layer list at the given index.
 boolean add(Layer e)
          Adds the given layer to this layer list and hence the Map to which this list belongs.
 boolean addAll(Collection<? extends Layer> c)
          Adds all supplied layer to this layer list.
 boolean addAll(int index, Collection<? extends Layer> c)
          Adds all supplied layer to this layer list at the given index.
 int addAllAbsent(Collection<? extends Layer> c)
          Adds each supplied layer to this layer list if it is not already in this layer list.
 boolean addIfAbsent(Layer e)
          Adds the supplied layer to this layer list if it is not already in this layer list.
 void addLayerListEventListener(LayerListEventListener listener)
          Adds the layer list event listener.
 void clear()
          Removes, that is clears all from this layers list.
protected  void fireLayerAdded(Layer layer, int index)
           
protected  void fireLayerRemoved(Layer layer, int index)
           
protected  void fireMultipleLayersAdded(Map<Integer,Layer> layers)
           
protected  void fireMultipleLayersRemoved(Map<Integer,Layer> layers)
           
 Layer remove(int index)
          Removes any layer at the given index and hence removes the layer from the Map which owns this layer list.
 boolean remove(Object o)
          Removes the given layer.
 boolean removeAll(Collection<?> c)
          Removes (that is clears) given layers from this layers list.
 void removeLayerListEventListener(LayerListEventListener listener)
          Removes the layer list event listener.
 boolean retainAll(Collection<?> c)
          Retains the given layers in this layers list and removes all others; that is any layer not given.
 Layer set(int index, Layer element)
          Sets the given layer at the given index.
 
Methods inherited from class java.util.concurrent.CopyOnWriteArrayList
clone, contains, containsAll, equals, get, hashCode, indexOf, indexOf, isEmpty, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, size, subList, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayerList

public LayerList()
Instantiates a new, empty layer list.


LayerList

public LayerList(Collection<? extends Layer> c)
Instantiates a new layer list with the given collection.

Parameters:
c - the collection of layers

LayerList

public LayerList(Layer[] toCopyIn)
Instantiates a new layer list with the given Layers

Parameters:
toCopyIn - the layers to copy in to this new LayerList
Method Detail

addLayerListEventListener

public void addLayerListEventListener(LayerListEventListener listener)
Adds the layer list event listener. Use this method to be notified when one or more layers are added or removed from this list; that is added or removed from the Map that owns this list.

Parameters:
listener - the listener

removeLayerListEventListener

public void removeLayerListEventListener(LayerListEventListener listener)
Removes the layer list event listener.

Parameters:
listener - the listener

set

public Layer set(int index,
                 Layer element)
Sets the given layer at the given index.

Specified by:
set in interface List<Layer>
Overrides:
set in class CopyOnWriteArrayList<Layer>
Parameters:
index - the index at which to put this layer
element - the layer to use

add

public boolean add(Layer e)
Adds the given layer to this layer list and hence the Map to which this list belongs. The layer will be initialized.

Specified by:
add in interface Collection<Layer>
Specified by:
add in interface List<Layer>
Overrides:
add in class CopyOnWriteArrayList<Layer>
Parameters:
e - the layer to add

add

public void add(int index,
                Layer element)
Adds the given layer to this layer list at the given index. Subsequent layers are moved towards the end of the collection and hence to the front of the z-order; that is towards the front of the display.

Specified by:
add in interface List<Layer>
Overrides:
add in class CopyOnWriteArrayList<Layer>
Parameters:
e - the layer to add
See Also:
add(Layer)

remove

public Layer remove(int index)
Removes any layer at the given index and hence removes the layer from the Map which owns this layer list.

Specified by:
remove in interface List<Layer>
Overrides:
remove in class CopyOnWriteArrayList<Layer>
Parameters:
index - the index from which to remove a layer

remove

public boolean remove(Object o)
Removes the given layer.

Specified by:
remove in interface Collection<Layer>
Specified by:
remove in interface List<Layer>
Overrides:
remove in class CopyOnWriteArrayList<Layer>
Parameters:
object - the layer

removeAll

public boolean removeAll(Collection<?> c)
Removes (that is clears) given layers from this layers list.

Specified by:
removeAll in interface Collection<Layer>
Specified by:
removeAll in interface List<Layer>
Overrides:
removeAll in class CopyOnWriteArrayList<Layer>
Parameters:
c - the layers

clear

public void clear()
Removes, that is clears all from this layers list.

Specified by:
clear in interface Collection<Layer>
Specified by:
clear in interface List<Layer>
Overrides:
clear in class CopyOnWriteArrayList<Layer>

addIfAbsent

public boolean addIfAbsent(Layer e)
Adds the supplied layer to this layer list if it is not already in this layer list.

Overrides:
addIfAbsent in class CopyOnWriteArrayList<Layer>
Parameters:
e - the layer
See Also:
add(Layer)

retainAll

public boolean retainAll(Collection<?> c)
Retains the given layers in this layers list and removes all others; that is any layer not given.

Specified by:
retainAll in interface Collection<Layer>
Specified by:
retainAll in interface List<Layer>
Overrides:
retainAll in class CopyOnWriteArrayList<Layer>
Parameters:
c - the layers to keep

addAllAbsent

public int addAllAbsent(Collection<? extends Layer> c)
Adds each supplied layer to this layer list if it is not already in this layer list.

Overrides:
addAllAbsent in class CopyOnWriteArrayList<Layer>
Parameters:
c - the layers to add
See Also:
add(Layer)

addAll

public boolean addAll(Collection<? extends Layer> c)
Adds all supplied layer to this layer list.

Specified by:
addAll in interface Collection<Layer>
Specified by:
addAll in interface List<Layer>
Overrides:
addAll in class CopyOnWriteArrayList<Layer>
Parameters:
c - the layers to add
See Also:
add(Layer)

addAll

public boolean addAll(int index,
                      Collection<? extends Layer> c)
Adds all supplied layer to this layer list at the given index. Subsequent layers are moved towards the end of the collection and hence to the front of the z-order; that is towards the front of the display.

Specified by:
addAll in interface List<Layer>
Overrides:
addAll in class CopyOnWriteArrayList<Layer>
Parameters:
c - the layers to add
See Also:
add(Layer)

fireLayerAdded

protected void fireLayerAdded(Layer layer,
                              int index)

fireMultipleLayersAdded

protected void fireMultipleLayersAdded(Map<Integer,Layer> layers)

fireLayerRemoved

protected void fireLayerRemoved(Layer layer,
                                int index)

fireMultipleLayersRemoved

protected void fireMultipleLayersRemoved(Map<Integer,Layer> layers)


Copyright © 2012. All Rights Reserved.