Interface GISTreeSet<P extends GISPrimitive,​N extends GISTreeNode<P,​N>>

    • Method Detail

      • getTree

        @Pure
        Tree<P,​N> getTree()
        Replies the internal tree data structure.
        Returns:
        the internal tree data structure.
      • getTreeNodeAt

        @Pure
        N getTreeNodeAt​(double x,
                        double y)
        Replies the tree node that is containing the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        Returns:
        the tree node with the givne point inside, or null if the point is outside all the tree nodes.
      • setNodeFactory

        void setNodeFactory​(GISTreeSetNodeFactory<P,​N> factory)
        Set the node factory used by this tree.
        Parameters:
        factory - the factory.
      • getNodeFactory

        @Pure
        GISTreeSetNodeFactory<P,​N> getNodeFactory()
        Replies the node factory used by this tree.
        Returns:
        the factory
      • isTypeRecomputedAfterRemoval

        @Pure
        boolean isTypeRecomputedAfterRemoval()
        Replies if this informed tree set is trying to compute the best fitting type after a removal. If false, this class will keep unchanged the previously computed type.
        Returns:
        true if the type is recomputed after a removal, false if not.
      • setTypeRecomputedAfterRemoval

        void setTypeRecomputedAfterRemoval​(boolean update)
        Set if this informed tree set is trying to compute the best fitting type after a removal. If false, this class will keep unchanged the previously computed type.
        Parameters:
        update - is true if the type is recomputed after a removal, false if not.
      • getElementType

        @Pure
        Class<? extends P> getElementType()
        Replies the class of the components in this list.
        Returns:
        the top most type of the array's elements.
      • get

        @Pure
        P get​(GeoId identifier)
        Replies the element which as the specified identifier.

        This function is time consuming because the location of the primitive could not be retreived from the geoId.

        Parameters:
        identifier - is the identifier to text.
        Returns:
        the entity or null if none was found.
      • get

        @Pure
        P get​(GeoLocation location)
        Replies the element which as the specified location.
        Parameters:
        location - is the location of the element to find.
        Returns:
        the entity or null if none was found.
      • get

        @Pure
        P get​(int index)
        Replies the element at the specified index.

        This method iterates until the right index.

        Parameters:
        index - the index.
        Returns:
        the element at the given index.
        Throws:
        IndexOutOfBoundsException - in case of error.
      • computeSize

        int computeSize()
        Force the deep computation of the element count in this set.
        Returns:
        the count of elements inside the tree.
      • slowContains

        @Pure
        boolean slowContains​(Object obj)
        Replies if the given object is inside the set by user a depth-first iteration on the internal tree.
        Parameters:
        obj - the object.
        Returns:
        true of o is inside, otherwise false
        See Also:
        Set.contains(Object)
      • indexOf

        @Pure
        int indexOf​(Object obj)
        Replies the index of the first instance the specified element.

        This method iterates until the right index.

        Parameters:
        obj - the object.
        Returns:
        the index or -1 if the object was not inside this set.
      • iterator

        @Pure
        Iterator<P> iterator​(Rectangle2afp<?,​?,​?,​?,​?,​?> clipBounds)
        Replies the set of elements that have an intersection with the specified rectangle.

        This function replies the elements with a broad-first iteration on the elements' tree.

        Parameters:
        clipBounds - is the bounds outside which the elements will not be replied
        Returns:
        the elements inside the specified bounds.
      • iterator

        @Pure
        Iterator<P> iterator​(Rectangle2afp<?,​?,​?,​?,​?,​?> clipBounds,
                             int budget)
        Replies the set of elements that have an intersection with the specified rectangle.

        This function replies the elements with a broad-first iteration on the elements' tree.

        Parameters:
        clipBounds - is the bounds outside which the elements will not be replied
        budget - is the maximal size of the replied list. If this value is negative, all the elements will be replied.
        Returns:
        the elements inside the specified bounds.
      • boundsIterator

        @Pure
        Iterator<Rectangle2afp<?,​?,​?,​?,​?,​?>> boundsIterator()
        Replies the bounding rectangles of the internal data-structure elements.
        Returns:
        the bounding boxes in the data-structure.
      • toIterable

        @Pure
        Iterable<P> toIterable​(Rectangle2afp<?,​?,​?,​?,​?,​?> clipBounds)
        Replies the set of elements that have an intersection with the specified rectangle.

        This function replies the elements with a broad-first iteration on the elements' tree.

        Parameters:
        clipBounds - is the bounds outside which the elements will not be replied
        Returns:
        the elements inside the specified bounds.
      • toIterable

        @Pure
        Iterable<P> toIterable​(Rectangle2afp<?,​?,​?,​?,​?,​?> clipBounds,
                               int budget)
        Replies the set of elements that have an intersection with the specified rectangle.

        This function replies the elements with a broad-first iteration on the elements' tree.

        Parameters:
        clipBounds - is the bounds outside which the elements will not be replied
        budget - is the maximal size of the replied list. If this value is negative, all the elements will be replied.
        Returns:
        the elements inside the specified bounds.