src/main/java/de/blau/android/validation/BaseValidator.java
/**
     * Check if the element is out of date and should be resurveyed
     * 
     * @param status previous validation status
     * @param e the OsmElement
     * @param tags the tags
     * @return new validation status
     */
Check if the element is out of date and should be resurveyed

@param status previous validation status
@param e the OsmElement
@param tags the tags
@return new validation status
Check if the element is out of date and should be resurveyed @param status previous validation status @param e the OsmElement @param tags the tags @return new validation status
public int validateResurvey(int status, @NonNull OsmElement e, @NonNull SortedMap<String, String> tags) {
        long now = System.currentTimeMillis() / 1000;
        long timestamp = e.getTimestamp();
        for (String key : resurveyTags.getKeys()) {
            if (tags.containsKey(key)) {
                for (PatternAndAge value : resurveyTags.get(key)) {
                    if ((value.getValue() == null || "".equals(value.getValue()) || value.matches(tags.get(key)))) {
                        long age = value.getAge();
                        if (timestamp >= 0 && (now - timestamp > age)) {
                            status |= Validator.AGE;
                        } else if (tags.containsKey(Tags.KEY_CHECK_DATE)) {
                            status |= checkAge(tags, now, Tags.KEY_CHECK_DATE, age);
                        } else {
                            final String keyCheckDate = Tags.KEY_CHECK_DATE + ":" + key;
                            if (tags.containsKey(keyCheckDate)) {
                                status |= checkAge(tags, now, keyCheckDate, age);
                            }
                        }
                    }
                }
            }
        }
        return status;
    }
public int validateResurvey ( int status , @ NonNull OsmElement e , @ NonNull SortedMap < String , String > tags ) { long now = System . currentTimeMillis ( ) / 1000 ; long timestamp = e . getTimestamp ( ) ; for ( String key : resurveyTags . getKeys ( ) ) { if ( tags . containsKey ( key ) ) { for ( PatternAndAge value : resurveyTags . get ( key ) ) { if ( ( value . getValue ( ) == null || "" . equals ( value . getValue ( ) ) || value . matches ( tags . get ( key ) ) ) ) { long age = value . getAge ( ) ; if ( timestamp >= 0 && ( now - timestamp > age ) ) { status |= Validator . AGE ; } else if ( tags . containsKey ( Tags . KEY_CHECK_DATE ) ) { status |= checkAge ( tags , now , Tags . KEY_CHECK_DATE , age ) ; } else { final String keyCheckDate = Tags . KEY_CHECK_DATE + ":" + key ; if ( tags . containsKey ( keyCheckDate ) ) { status |= checkAge ( tags , now , keyCheckDate , age ) ; } } } } } } return status ; }
Check if the element is out of date and should be resurveyed
Check if the element is out of date and should be resurveyed
// timestamp is too old // check_date tag is too old // key specific check_date tag is too old