Class LayerList
- java.lang.Object
-
- com.esri.arcgisruntime.mapping.LayerList
-
- All Implemented Interfaces:
ListenableList<Layer>
,Iterable<Layer>
,Collection<Layer>
,List<Layer>
public final class LayerList extends 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, Collection<? extends Layer> layers)
boolean
addAll(Collection<? extends Layer> layers)
void
addListChangedListener(ListChangedListener<Layer> listener)
Adds a listener for added and removed events.void
clear()
boolean
contains(Object object)
boolean
containsAll(Collection<?> collection)
Layer
get(int index)
int
indexOf(Object object)
boolean
isEmpty()
Iterator<Layer>
iterator()
int
lastIndexOf(Object object)
ListIterator<Layer>
listIterator()
ListIterator<Layer>
listIterator(int index)
Layer
remove(int index)
boolean
remove(Object object)
boolean
removeAll(Collection<?> collection)
boolean
removeListChangedListener(ListChangedListener<Layer> listener)
Removes the given listener from this class instance.boolean
retainAll(Collection<?> collection)
Layer
set(int index, Layer layer)
int
size()
List<Layer>
subList(int start, int end)
Object[]
toArray()
<T> T[]
toArray(T[] array)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
add
public boolean add(Layer layer)
-
addAll
public boolean addAll(int index, Collection<? extends Layer> layers)
-
addAll
public boolean addAll(Collection<? extends Layer> layers)
-
clear
public void clear()
-
contains
public boolean contains(Object object)
-
containsAll
public boolean containsAll(Collection<?> collection)
- Specified by:
containsAll
in interfaceCollection<Layer>
- Specified by:
containsAll
in interfaceList<Layer>
-
isEmpty
public boolean isEmpty()
-
lastIndexOf
public int lastIndexOf(Object object)
- Specified by:
lastIndexOf
in interfaceList<Layer>
-
listIterator
public ListIterator<Layer> listIterator()
- Specified by:
listIterator
in interfaceList<Layer>
-
listIterator
public ListIterator<Layer> listIterator(int index)
- Specified by:
listIterator
in interfaceList<Layer>
-
remove
public boolean remove(Object object)
-
removeAll
public boolean removeAll(Collection<?> collection)
-
retainAll
public boolean retainAll(Collection<?> collection)
-
size
public int size()
-
toArray
public 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
-
-