Class LayerList
- java.lang.Object
-
- com.esri.arcgisruntime.mapping.LayerList
-
- All Implemented Interfaces:
ListenableList<Layer>
,java.lang.Iterable<Layer>
,java.util.Collection<Layer>
,java.util.List<Layer>
public final class LayerList extends java.lang.Object implements ListenableList<Layer>
Represents the operational layers of an ArcGISMap or the base or reference layers of a Basemap.This class is not creatable but layers can be added and removed. Changes to the list can be observed by adding a ListChangedListener.
If the layers in the list are rendered in a MapView, changes to the list will have an immediate effect on how these layers are rendered in that MapView. If a layer is removed from the list it will disappear from the MapView and vice versa if a layer is added to the list it will be rendered in the MapView.
The order in which layers are rendered in the MapView corresponds with the order of the layers in the list. The layer at index 0 is rendered as the bottom most layer, followed by the layer at index 1 being drawn above 0, and so on. Note: Elements within this list type will always be automatically wrapped.
- Since:
- 100.0.0
- See Also:
ListenableList
,Layer
,GeoModel.getOperationalLayers()
,Basemap.getBaseLayers()
,Basemap.getReferenceLayers()
,MapView
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Layer layer)
boolean
add(Layer layer)
boolean
addAll(int index, java.util.Collection<? extends Layer> layers)
boolean
addAll(java.util.Collection<? extends Layer> layers)
void
addListChangedListener(ListChangedListener<Layer> listener)
Adds a listener for added and removed events.void
clear()
boolean
contains(java.lang.Object object)
boolean
containsAll(java.util.Collection<?> collection)
Layer
get(int index)
int
indexOf(java.lang.Object object)
boolean
isEmpty()
java.util.Iterator<Layer>
iterator()
int
lastIndexOf(java.lang.Object object)
java.util.ListIterator<Layer>
listIterator()
java.util.ListIterator<Layer>
listIterator(int index)
Layer
remove(int index)
boolean
remove(java.lang.Object object)
boolean
removeAll(java.util.Collection<?> collection)
boolean
removeListChangedListener(ListChangedListener<Layer> listener)
Removes the given listener from this class instance.boolean
retainAll(java.util.Collection<?> collection)
Layer
set(int index, Layer layer)
int
size()
java.util.List<Layer>
subList(int start, int end)
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] array)
-
-
-
Method Detail
-
add
public boolean add(Layer layer)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends Layer> layers)
- Specified by:
addAll
in interfacejava.util.List<Layer>
-
addAll
public boolean addAll(java.util.Collection<? extends Layer> layers)
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object object)
-
containsAll
public boolean containsAll(java.util.Collection<?> collection)
-
indexOf
public int indexOf(java.lang.Object object)
- Specified by:
indexOf
in interfacejava.util.List<Layer>
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<Layer> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object object)
- Specified by:
lastIndexOf
in interfacejava.util.List<Layer>
-
listIterator
public java.util.ListIterator<Layer> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<Layer>
-
listIterator
public java.util.ListIterator<Layer> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<Layer>
-
remove
public boolean remove(java.lang.Object object)
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
-
retainAll
public boolean retainAll(java.util.Collection<?> collection)
-
size
public int size()
-
subList
public java.util.List<Layer> subList(int start, int end)
- Specified by:
subList
in interfacejava.util.List<Layer>
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] array)
-
addListChangedListener
public void addListChangedListener(ListChangedListener<Layer> listener)
Description copied from interface:ListenableList
Adds a listener for added and removed events.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
- Specified by:
addListChangedListener
in interfaceListenableList<Layer>
- Parameters:
listener
- this listener will be called back when items are added to or removed from the list
-
removeListChangedListener
public boolean removeListChangedListener(ListChangedListener<Layer> listener)
Description copied from interface:ListenableList
Removes the given listener from this class instance. It will no longer receive added or removed events.- Specified by:
removeListChangedListener
in interfaceListenableList<Layer>
- Parameters:
listener
- listener to remove- Returns:
- true if the listenable list contained the given listener, false otherwise
-
-