Class GridMapElementLayer<E extends MapElement>

    • Field Detail

      • MINIMUM_CELL_SIZE

        public static final float MINIMUM_CELL_SIZE
        The minimum size of the cells (in meters).
        See Also:
        Constant Field Values
      • MAXIMUM_CELL_COUNT

        public static final int MAXIMUM_CELL_COUNT
        The maximum number of cells per row or per column.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GridMapElementLayer

        public GridMapElementLayer​(Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        bounds - are the bounds covered by the layer
      • GridMapElementLayer

        public GridMapElementLayer​(AttributeCollection attributeSource,
                                   Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        attributeSource - is the provider of the layer's attributes.
        bounds - are the bounds covered by the layer
      • GridMapElementLayer

        public GridMapElementLayer​(boolean isTemp,
                                   Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        isTemp - indicates if this layer is temporary.
        bounds - are the bounds covered by the layer
      • GridMapElementLayer

        public GridMapElementLayer​(AttributeCollection attributeSource,
                                   boolean isTemp,
                                   Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        attributeSource - is the provider of the layer's attributes.
        isTemp - indicates if this layer is temporary.
        bounds - are the bounds covered by the layer
      • GridMapElementLayer

        public GridMapElementLayer​(UUID id,
                                   Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        bounds - are the bounds covered by the layer
      • GridMapElementLayer

        public GridMapElementLayer​(UUID id,
                                   AttributeCollection attributeSource,
                                   Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeSource - is the provider of the layer's attributes.
        bounds - are the bounds covered by the layer
      • GridMapElementLayer

        public GridMapElementLayer​(UUID id,
                                   boolean isTemp,
                                   Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        isTemp - indicates if this layer is temporary.
        bounds - are the bounds covered by the layer
      • GridMapElementLayer

        public GridMapElementLayer​(UUID id,
                                   AttributeCollection attributeSource,
                                   boolean isTemp,
                                   Rectangle2d bounds)
        Create a new layer with the specified attribute source.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeSource - is the provider of the layer's attributes.
        isTemp - indicates if this layer is temporary.
        bounds - are the bounds covered by the layer
    • Method Detail

      • getRowCount

        @Pure
        public int getRowCount()
        Replies the number of rows in the grid.
        Returns:
        the number of rows in the grid.
      • getColumnCount

        @Pure
        public int getColumnCount()
        Replies the number of columns in the grid.
        Returns:
        the number of columns in the grid.
      • size

        @Pure
        public int size()
        Description copied from interface: GISContainer
        Replies the count of map elements inside this container.
        Returns:
        the count of map elements inside this container.
      • getMapElementAt

        @Pure
        public E getMapElementAt​(int index)
        Description copied from interface: GISElementContainer
        Replies the map element at the specified index.
        Parameters:
        index - the index.
        Returns:
        the element at the given index
      • getAllMapElements

        @Pure
        public Set<E> getAllMapElements()
        Description copied from interface: GISElementContainer
        Replies the map elements as an array.
        Returns:
        all the elements.
      • addMapElements

        public boolean addMapElements​(Collection<? extends E> elements)
        Description copied from interface: GISElementContainer
        Add map elements inside this container.
        Parameters:
        elements - the new elements.
        Returns:
        true if at least one element was added, otherwise false
      • addMapElement

        public boolean addMapElement​(E element)
        Description copied from interface: GISElementContainer
        Add a map element inside this container.
        Parameters:
        element - the new element.
        Returns:
        true if the element was added successfully, otherwise false
      • removeMapElement

        public boolean removeMapElement​(MapElement element)
        Description copied from interface: GISElementContainer
        Remove a map element from this container.
        Parameters:
        element - the element to remove.
        Returns:
        true if the element was removed successfully, otherwise false
      • removeAllMapElements

        public boolean removeAllMapElements()
        Description copied from interface: GISElementContainer
        Remove all the map elements from this container.
        Returns:
        true if container has changed, otherwise false
      • getElementType

        @Pure
        public Class<? extends E> getElementType()
        Description copied from interface: InformedIterable
        Replies the class of the elements in this iterable object.
        Returns:
        the type of the elements.
      • getMapElementCount

        @Pure
        public int getMapElementCount()
        Description copied from interface: GISElementContainer
        Replies the count of map elements.
        Returns:
        the count of map elements.
      • iterator

        @Pure
        public Iterator<E> iterator​(Rectangle2afp<?,​?,​?,​?,​?,​?> bounds)
        Iterates on the elements that intersect the specified bounds.
        Parameters:
        bounds - is the rectangle inside which the replied elements must be located
        Returns:
        an iterator on the map elements.
      • iterator

        @Pure
        public Iterator<E> iterator()