src/main/java/de/blau/android/easyedit/EasyEditActionModeCallback.java
/**
     * Finds which ways can be merged with a way. For this, the ways must not be equal, need to share at least one end
     * node, and either at least one of them must not have tags, or the tags on both ways must be equal.
     * 
     * @param way the way into which other ways may be merged
     * @return a list of all ways which can be merged into the given way
     */
Finds which ways can be merged with a way. For this, the ways must not be equal, need to share at least one end
node, and either at least one of them must not have tags, or the tags on both ways must be equal.

@param way the way into which other ways may be merged
@return a list of all ways which can be merged into the given way
Finds which ways can be merged with a way . For this the ways must not be equal need to share at least one end node and either at least one of them must not have tags or the tags on both ways must be equal . @param way the way into which other ways may be merged @return a list of all ways which can be merged into the given way
protected Set<OsmElement> findMergeableWays(@NonNull Way way) {
        Set<Way> candidates = new HashSet<>();
        Set<OsmElement> result = new HashSet<>();
        candidates.addAll(logic.getWaysForNode(way.getFirstNode()));
        candidates.addAll(logic.getWaysForNode(way.getLastNode()));
        for (Way candidate : candidates) {
            if ((way != candidate) && (candidate.isEndNode(way.getFirstNode()) || candidate.isEndNode(way.getLastNode()))
                    && (candidate.getTags().isEmpty() || way.getTags().isEmpty() || way.getTags().entrySet().equals(candidate.getTags().entrySet()))
            ) {
                result.add(candidate);
            }
        }
        return result;
    }
protected Set < OsmElement > findMergeableWays ( @ NonNull Way way ) { Set < Way > candidates = new HashSet < > ( ) ; Set < OsmElement > result = new HashSet < > ( ) ; candidates . addAll ( logic . getWaysForNode ( way . getFirstNode ( ) ) ) ; candidates . addAll ( logic . getWaysForNode ( way . getLastNode ( ) ) ) ; for ( Way candidate : candidates ) { if ( ( way != candidate ) && ( candidate . isEndNode ( way . getFirstNode ( ) ) || candidate . isEndNode ( way . getLastNode ( ) ) ) && ( candidate . getTags ( ) . isEmpty ( ) || way . getTags ( ) . isEmpty ( ) || way . getTags ( ) . entrySet ( ) . equals ( candidate . getTags ( ) . entrySet ( ) ) ) ) { result . add ( candidate ) ; } } return result ; }
Finds which ways can be merged with a way.
Finds which ways can be merged with a way .
// TODO check for relations too