src/main/java/org/g_node/nix/Section.java
/**
     * Get all descendant sections of the section recursively.
     * <p>
     * This method traverses the sub-tree of all child sections of the section. The traversal
     * is accomplished via breadth first and can be limited in depth. On each node or
     * section a filter is applied. If the filter returns true the respective section
     * will be added to the result list.
     *
     * @param filter   A filter function.
     * @param maxDepth The maximum depth of traversal.
     * @return A list containing the matching descendant sections.
     * @see Section
     */
Get all descendant sections of the section recursively.

This method traverses the sub-tree of all child sections of the section. The traversal
is accomplished via breadth first and can be limited in depth. On each node or
section a filter is applied. If the filter returns true the respective section
will be added to the result list.

@param filter   A filter function.
@param maxDepth The maximum depth of traversal.
@return A list containing the matching descendant sections.
@see Section
Get all descendant sections of the section recursively . This method traverses the sub - tree of all child sections of the section . The traversal is accomplished via breadth first and can be limited in depth . On each node or section a filter is applied . If the filter returns true the respective section will be added to the result list . @param filter A filter function . @param maxDepth The maximum depth of traversal . @return A list containing the matching descendant sections . @see Section
public List<Section> findSections(Predicate<Section> filter, int maxDepth) {
        List<Section> results = new ArrayList<>();
        Queue<SectionCont> todo = new LinkedList<>();
        int level = 0;
        todo.add(new SectionCont(this, level));
        while (todo.size() > 0) {
            SectionCont current = todo.remove();
            if (filter.test(current.entity)) {
                results.add(current.entity);
            }
            if (current.depth < maxDepth) {
                List<Section> children = current.entity.getSections();
                int next_depth = current.depth + 1;
                for (Section child : children) {
                    todo.add(new SectionCont(child, next_depth));
                }
            }
        }
        return results;
    }
public List < Section > findSections ( Predicate < Section > filter , int maxDepth ) { List < Section > results = new ArrayList < > ( ) ; Queue < SectionCont > todo = new LinkedList < > ( ) ; int level = 0 ; todo . add ( new SectionCont ( this , level ) ) ; while ( todo . size ( ) > 0 ) { SectionCont current = todo . remove ( ) ; if ( filter . test ( current . entity ) ) { results . add ( current . entity ) ; } if ( current . depth < maxDepth ) { List < Section > children = current . entity . getSections ( ) ; int next_depth = current . depth + 1 ; for ( Section child : children ) { todo . add ( new SectionCont ( child , next_depth ) ) ; } } } return results ; }
Get all descendant sections of the section recursively.
Get all descendant sections of the section recursively .