Class SimpleElement

    • Constructor Detail

      • SimpleElement

        public SimpleElement()
        Deprecated.
    • Method Detail

      • clone

        public SimpleElement clone()
        Deprecated.
        Returns a shallow copy of this element. In particular, its parent and children will be cleared.
        Overrides:
        clone in class Object
        Returns:
        a copy of this element
      • getChildren

        @Nonnull
        public SortedSet<? extends Element> getChildren()
        Deprecated.
        This default implementation uses the newChildrenInstance() to initialize the children set and wraps it in a private set implementation that automagically changes the parent of the elements based on the membership.
        Specified by:
        getChildren in interface Element
        Returns:
        children of this element
      • newChildrenInstance

        @Nonnull
        protected SortedSet<Element> newChildrenInstance()
        Deprecated.
        Override this method if you need some specialized instance of sorted set or want to do some custom pre-populating or initialization of the children. This default implementation merely returns an empty new TreeSet instance.
        Returns:
        a new sorted set instance to store the children in
      • setParent

        public void setParent​(@Nullable
                              Element parent)
        Deprecated.
        Sets the parent element. No other processing is automagically done (i.e. the parent's children set is NOT updated by calling this method).
        Specified by:
        setParent in interface Element
        Parameters:
        parent - the new parent element
      • searchChildren

        @Nonnull
        public final List searchChildren​(@Nonnull
                                         Class resultType,
                                         boolean recurse,
                                         @Nullable
                                         Filter filter)
        Deprecated.
        Description copied from interface: Element
        This method is functionally equivalent to Element.searchChildren(java.util.List, java.lang.Class, boolean, org.revapi.query.Filter) but returns the result in a newly allocated list instance. This is basically a convenience method to enable a more succinct expressions.
        Specified by:
        searchChildren in interface Element
        Parameters:
        resultType - the type of the elements to look for
        recurse - false to search only in direct children of the element, true to search recursively
        filter - optional filter to further trim the number of results @return the list of child elements of given type potentially satisfying given filter
        Returns:
        the list of found elements
      • searchChildren

        public final void searchChildren​(@Nonnull
                                         List results,
                                         @Nonnull
                                         Class resultType,
                                         boolean recurse,
                                         @Nullable
                                         Filter filter)
        Deprecated.
        Description copied from interface: Element
        Recursively searches the children of this element for elements of given type, potentially applicable to given filter.

        This is identical to Element.searchChildren(Class, boolean, org.revapi.query.Filter) in behavior but avoids the instantiation of a new list.

        Specified by:
        searchChildren in interface Element
        Parameters:
        results - the list of the results to fill
        resultType - the type of the elements to look for
        recurse - false to search only in direct children of the element, true to search recursively
        filter - optional filter to further trim the number of results
      • iterateOverChildren

        @Nonnull
        public Iterator iterateOverChildren​(@Nonnull
                                            Class resultType,
                                            boolean recurse,
                                            @Nullable
                                            Filter filter)
        Deprecated.
        Description copied from interface: Element
        Similar to search methods but avoids the traversal over the whole forest. Instead the traversal is incremental and governed by the returned iterator.
        Specified by:
        iterateOverChildren in interface Element
        Parameters:
        resultType - the type of elements to look for
        recurse - if true, the iterator traverses the element forest using depth first search
        filter - optional filter to further trim the number of results
        Returns:
        the iterator that will iterate over the results
        See Also:
        Element.searchChildren(Class, boolean, org.revapi.query.Filter)