use of uk.me.parabola.mkgmap.osmstyle.actions.DeleteAction in project mkgmap by openstreetmap.
the class RuleFileReader method possiblyChanged.
/**
* Check if the expression depends on tags modified by an action in the action list.
* @param expr the expression to check
* @param actionList the ActionList
* @return true if the value of the expression depends on one or more of the changeable tags
*/
private boolean possiblyChanged(Op expr, ActionList actionList) {
Set<String> evaluated = expr.getEvaluatedTagKeys();
if (evaluated.isEmpty())
return false;
for (String tagKey : evaluated) {
for (String s : actionList.getChangeableTags()) {
int pos = s.indexOf("=");
String key = pos > 0 ? s.substring(0, pos) : s;
if (tagKey.equals(key)) {
return true;
}
}
for (Action a : actionList.getList()) {
if (a instanceof DeleteAction) {
if (a.toString().contains(tagKey)) {
return true;
}
}
}
}
return false;
}
Aggregations