Class MapLayers

  • All Implemented Interfaces:
    java.lang.Iterable<MapLayer>

    public class MapLayers
    extends java.lang.Object
    implements java.lang.Iterable<MapLayer>
    Ordered list of MapLayer instances owned by a Map
    • Constructor Summary

      Constructors 
      Constructor Description
      MapLayers()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(MapLayer layer)  
      MapLayer get​(int index)  
      MapLayer get​(java.lang.String name)  
      <T extends MapLayer>
      Array<T>
      getByType​(java.lang.Class<T> type)  
      <T extends MapLayer>
      Array<T>
      getByType​(java.lang.Class<T> type, Array<T> fill)  
      int getCount()  
      int getIndex​(MapLayer layer)
      Get the index of the layer in the collection, or -1 if no such layer exists.
      int getIndex​(java.lang.String name)
      Get the index of the layer having the specified name, or -1 if no such layer exists.
      java.util.Iterator<MapLayer> iterator()  
      void remove​(int index)  
      void remove​(MapLayer layer)  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • MapLayers

        public MapLayers()
    • Method Detail

      • get

        public MapLayer get​(int index)
        Parameters:
        index -
        Returns:
        the MapLayer at the specified index
      • get

        public MapLayer get​(java.lang.String name)
        Parameters:
        name -
        Returns:
        the first layer having the specified name, if one exists, otherwise null
      • getIndex

        public int getIndex​(java.lang.String name)
        Get the index of the layer having the specified name, or -1 if no such layer exists.
      • getIndex

        public int getIndex​(MapLayer layer)
        Get the index of the layer in the collection, or -1 if no such layer exists.
      • getCount

        public int getCount()
        Returns:
        number of layers in the collection
      • add

        public void add​(MapLayer layer)
        Parameters:
        layer - layer to be added to the set
      • remove

        public void remove​(int index)
        Parameters:
        index - removes layer at index
      • remove

        public void remove​(MapLayer layer)
        Parameters:
        layer - layer to be removed
      • size

        public int size()
        Returns:
        the number of map layers
      • getByType

        public <T extends MapLayerArray<T> getByType​(java.lang.Class<T> type)
        Parameters:
        type -
        Returns:
        array with all the layers matching type
      • getByType

        public <T extends MapLayerArray<T> getByType​(java.lang.Class<T> type,
                                                       Array<T> fill)
        Parameters:
        type -
        fill - array to be filled with the matching layers
        Returns:
        array with all the layers matching type
      • iterator

        public java.util.Iterator<MapLayer> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<MapLayer>
        Returns:
        iterator to set of layers