src/main/java/de/blau/android/easyedit/EasyEditActionModeCallback.java
/**
     * Find possible elements for the "to" role of a restriction relation
     * 
     * @param viaElement the current via OSM element
     * @return a set of the candidate to OSM elements
     */
Find possible elements for the "to" role of a restriction relation

@param viaElement the current via OSM element
@return a set of the candidate to OSM elements
Find possible elements for the " to " role of a restriction relation @param viaElement the current via OSM element @return a set of the candidate to OSM elements
protected Set<OsmElement> findToElements(@NonNull OsmElement viaElement) {
        Set<OsmElement> result = new HashSet<>();
        Set<Node> nodes = new HashSet<>();
        if (Node.NAME.equals(viaElement.getName())) {
            nodes.add((Node) viaElement);
        } else if (Way.NAME.equals(viaElement.getName())) {
            nodes.addAll(((Way) viaElement).getNodes());
        } else {
            Log.e(DEBUG_TAG, "Unknown element type for via element " + viaElement.getName() + " " + viaElement.getDescription());
        }
        for (Node n : nodes) {
            for (Way w : logic.getWaysForNode(n)) {
                if (w.getTagWithKey(Tags.KEY_HIGHWAY) != null) {
                    result.add(w);
                }
            }
        }
        return result;
    }
protected Set < OsmElement > findToElements ( @ NonNull OsmElement viaElement ) { Set < OsmElement > result = new HashSet < > ( ) ; Set < Node > nodes = new HashSet < > ( ) ; if ( Node . NAME . equals ( viaElement . getName ( ) ) ) { nodes . add ( ( Node ) viaElement ) ; } else if ( Way . NAME . equals ( viaElement . getName ( ) ) ) { nodes . addAll ( ( ( Way ) viaElement ) . getNodes ( ) ) ; } else { Log . e ( DEBUG_TAG , "Unknown element type for via element " + viaElement . getName ( ) + " " + viaElement . getDescription ( ) ) ; } for ( Node n : nodes ) { for ( Way w : logic . getWaysForNode ( n ) ) { if ( w . getTagWithKey ( Tags . KEY_HIGHWAY ) != null ) { result . add ( w ) ; } } } return result ; }
Find possible elements for the "to" role of a restriction relation
Find possible elements for the " to " role of a restriction relation