src/main/java/de/blau/android/easyedit/EasyEditActionModeCallback.java
/**
     * Finds which ways or nodes can be used as a via element in a restriction relation
     * 
     * @param way the from way
     * @param includeNodes if true include via nodes
     * @return a list of all applicable objects
     */
Finds which ways or nodes can be used as a via element in a restriction relation

@param way the from way
@param includeNodes if true include via nodes
@return a list of all applicable objects
Finds which ways or nodes can be used as a via element in a restriction relation @param way the from way @param includeNodes if true include via nodes @return a list of all applicable objects
protected Set<OsmElement> findViaElements(@Nullable Way way, boolean includeNodes) {
        Set<OsmElement> result = new HashSet<>();
        if (way != null) {
            for (Node n : way.getNodes()) {
                for (Way w : logic.getWaysForNode(n)) {
                    if (w.getTagWithKey(Tags.KEY_HIGHWAY) != null) {
                        result.add(w);
                        if (includeNodes) {
                            result.add(n); 
                        }
                    }
                }
            }
        } else {
            Log.d(DEBUG_TAG, "Null way passed to findViaELements");
        }
        return result;
    }
protected Set < OsmElement > findViaElements ( @ Nullable Way way , boolean includeNodes ) { Set < OsmElement > result = new HashSet < > ( ) ; if ( way != null ) { for ( Node n : way . getNodes ( ) ) { for ( Way w : logic . getWaysForNode ( n ) ) { if ( w . getTagWithKey ( Tags . KEY_HIGHWAY ) != null ) { result . add ( w ) ; if ( includeNodes ) { result . add ( n ) ; } } } } } else { Log . d ( DEBUG_TAG , "Null way passed to findViaELements" ) ; } return result ; }
Finds which ways or nodes can be used as a via element in a restriction relation
Finds which ways or nodes can be used as a via element in a restriction relation
// result is a set so we wont get dups