|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.me.parabola.mkgmap.osmstyle.RuleSet
public class RuleSet
A list of rules and the logic to select the correct one.
A separate RuleIndex
class is used to speed access to the rule list.
Constructor Summary | |
---|---|
RuleSet()
|
Method Summary | |
---|---|
void |
add(java.lang.String keystring,
Rule rule,
java.util.Set<java.lang.String> changeableTags)
Add a rule to this rule set. |
void |
addAll(RuleSet rs)
Add all rules from the given rule set to this one. |
void |
addUsedTags(java.util.Collection<java.lang.String> usedTags)
|
java.util.Set<java.lang.String> |
getUsedTags()
|
java.util.Iterator<Rule> |
iterator()
|
void |
merge(RuleSet rs)
Merge the two rulesets together so that they appear to be one. |
void |
prepare()
Prepare this rule set for use. |
void |
resolveType(Element el,
TypeResult result)
Resolve the type for this element by running the rules in order. |
java.lang.String |
toString()
Format the rule set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RuleSet()
Method Detail |
---|
public void resolveType(Element el, TypeResult result)
resolveType
in interface Rule
el
- The element as read from an OSM xml file in 'tag' format.result
- A GType describing the Garmin type of the first rule that
matches is returned here. If continue types are used then more than
one type may be saved here. If there are no matches then nothing will
be saved.public java.util.Iterator<Rule> iterator()
iterator
in interface java.lang.Iterable<Rule>
public void add(java.lang.String keystring, Rule rule, java.util.Set<java.lang.String> changeableTags)
keystring
- The string form of the first term of the rule. It will
be A=B or A=*. (In the future we may allow other forms).rule
- The actual rule.changeableTags
- The tags that may be changed by the rule. This
will be either a plain tag name A, or with a value A=B.public void addAll(RuleSet rs)
rs
- The other rule set.public java.lang.String toString()
toString
in class java.lang.Object
public void merge(RuleSet rs)
rs
- The other rule set, it will have lower priority, that is the
rules will be tried after the rules of this ruleset.public void prepare()
public java.util.Set<java.lang.String> getUsedTags()
public void addUsedTags(java.util.Collection<java.lang.String> usedTags)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |