src/main/java/de/blau/android/presets/Preset.java
/**
     * Return a set of presets that could match the tags
     * 
     * @param presets current presets
     * @param tags the tags
     * @param useAddressKeys use address keys
     * @return set of presets
     */
Return a set of presets that could match the tags

@param presets current presets
@param tags the tags
@param useAddressKeys use address keys
@return set of presets
Return a set of presets that could match the tags @param presets current presets @param tags the tags @param useAddressKeys use address keys @return set of presets
@NonNull
    private static Set<PresetItem> buildPossibleMatches(@NonNull Preset[] presets, @NonNull Map<String, String> tags, boolean useAddressKeys) {
        Set<PresetItem> possibleMatches = new LinkedHashSet<>();
        for (Preset p : presets) {
            if (p != null) {
                for (Entry<String, String> tag : tags.entrySet()) {
                    String key = tag.getKey();
                    if (useAddressKeys || !key.startsWith(Tags.KEY_ADDR_BASE)) {
                        String tagString = key + "\t";
                        possibleMatches.addAll(p.objectItems.get(tagString)); 
                        possibleMatches.addAll(p.objectItems.get(tagString + tag.getValue()));
                    }
                }
            }
        }
        return possibleMatches;
    }
@ NonNull private static Set < PresetItem > buildPossibleMatches ( @ NonNull Preset [ ] presets , @ NonNull Map < String , String > tags , boolean useAddressKeys ) { Set < PresetItem > possibleMatches = new LinkedHashSet < > ( ) ; for ( Preset p : presets ) { if ( p != null ) { for ( Entry < String , String > tag : tags . entrySet ( ) ) { String key = tag . getKey ( ) ; if ( useAddressKeys || ! key . startsWith ( Tags . KEY_ADDR_BASE ) ) { String tagString = key + "\t" ; possibleMatches . addAll ( p . objectItems . get ( tagString ) ) ; possibleMatches . addAll ( p . objectItems . get ( tagString + tag . getValue ( ) ) ) ; } } } } return possibleMatches ; }
Return a set of presets that could match the tags
Return a set of presets that could match the tags
// for stuff that doesn't have fixed // values