Class TagConflictResolutionUtil.AutomaticChoice
- java.lang.Object
-
- org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticChoice
-
- Enclosing class:
- TagConflictResolutionUtil
public static class TagConflictResolutionUtil.AutomaticChoice extends Object
Preference for a particular choice from a group for automatic tag conflict resolution.AutomaticChoice
s are grouped intoTagConflictResolutionUtil.AutomaticChoiceGroup
.- Since:
- 11606
-
-
Field Summary
Fields Modifier and Type Field Description String
description
A free description.String
group
The name of the {link AutomaticChoice group} this choice belongs to.boolean
isRegex
If regular expression must be used to match the Tag key or the value.String
key
The Tag key to match.String
score
The score to give to this choice in order to choose the best value Natural String ordering is used to identify the best score.String
value
The Tag value to match.
-
Constructor Summary
Constructors Constructor Description AutomaticChoice()
Default constructor.AutomaticChoice(String key, String group, String description, boolean isRegex, String value, String score)
Instantiate a particular choice from a group for automatic tag conflict resolution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
computeScoreFromValue(String v)
Return the score associated to this choice for the given Tag value.boolean
matchesValue(String v)
Check if this choice match the given Tag value.String
toString()
-
-
-
Field Detail
-
description
public String description
A free description.
-
isRegex
public boolean isRegex
If regular expression must be used to match the Tag key or the value.
-
-
Constructor Detail
-
AutomaticChoice
public AutomaticChoice()
Default constructor.
-
AutomaticChoice
public AutomaticChoice(String key, String group, String description, boolean isRegex, String value, String score)
Instantiate a particular choice from a group for automatic tag conflict resolution.- Parameters:
key
- The Tag key to match.group
- The name of the {link AutomaticChoice group} this choice belongs to.description
- A free description.isRegex
- If regular expression must be used to match the Tag key or the value.value
- The Tag value to match.score
- The score to give to this choice in order to choose the best value.
-
-
Method Detail
-
matchesValue
public boolean matchesValue(String v)
Check if this choice match the given Tag value.- Parameters:
v
- the Tag value to match.- Returns:
- true if this choice correspond to the given tag value.
-
computeScoreFromValue
public String computeScoreFromValue(String v)
Return the score associated to this choice for the given Tag value. For the result to be valid the given tag value mustmatch
this choice.- Parameters:
v
- the Tag value of which to get the score.- Returns:
- the score associated to the given Tag value.
- Throws:
PatternSyntaxException
- if the regular expression syntax is invalid
-
-