src/main/java/org/g_node/nix/Section.java
/**
     * Find all related sections of the section.
     *
     * @param filter A filter function.
     * @return A list containing all filtered related sections.
     * @see Section
     */
Find all related sections of the section.
@param filter A filter function.
@return A list containing all filtered related sections.
@see Section
Find all related sections of the section . @param filter A filter function . @return A list containing all filtered related sections . @see Section
public List<Section> findRelated(Predicate<Section> filter) {
        List<Section> results = findDownstream(filter);
        String myId = getId();
        results.removeIf(s -> s.getId().equals(myId));
        int resultsSize = results.size();
        if (resultsSize == 0) {
            results = findUpstream(filter);
        }
        results.removeIf(s -> s.getId().equals(myId));
        resultsSize = results.size();
        if (resultsSize == 0) {
            results = findSideways(filter, getId());
        }
        return results;
    }
public List < Section > findRelated ( Predicate < Section > filter ) { List < Section > results = findDownstream ( filter ) ; String myId = getId ( ) ; results . removeIf ( s -> s . getId ( ) . equals ( myId ) ) ; int resultsSize = results . size ( ) ; if ( resultsSize == 0 ) { results = findUpstream ( filter ) ; } results . removeIf ( s -> s . getId ( ) . equals ( myId ) ) ; resultsSize = results . size ( ) ; if ( resultsSize == 0 ) { results = findSideways ( filter , getId ( ) ) ; } return results ; }
Find all related sections of the section.
Find all related sections of the section .
//This checking of results can be removed if we decide not to include this in findSection //This checking of results can be removed if we decide not to include this in findSection