Class ConditionFactory.KeyValueCondition
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueCondition
-
- All Implemented Interfaces:
Condition,Condition.TagCondition
- Direct Known Subclasses:
ConditionFactory.KeyValueRegexpCondition
- Enclosing class:
- ConditionFactory
public static class ConditionFactory.KeyValueCondition extends java.lang.Object implements Condition.TagCondition
Represents a key/value condition which is either applied to a primitive.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Condition
Condition.Context, Condition.TagCondition
-
-
Field Summary
Fields Modifier and Type Field Description booleanconsiderValAsKeyIf this flag is set,vis treated as a key and the value is the value set for that key.java.lang.StringkThe key to search for.ConditionFactory.OpopThe key/value match operation.java.lang.StringvThe value to search for.
-
Constructor Summary
Constructors Constructor Description KeyValueCondition(java.lang.String k, java.lang.String v, ConditionFactory.Op op, boolean considerValAsKey)Creates a key/value-condition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapplies(Tagged osm)Checks if the condition applies in the givenTaggedelement.TagasTag(Tagged primitive)Converts the current condition to a tagbooleanrequiresExactKeyMatch()Determines if this condition requires an exact key match.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Condition.TagCondition
applies
-
-
-
-
Field Detail
-
k
public final java.lang.String k
The key to search for.
-
v
public final java.lang.String v
The value to search for.
-
op
public final ConditionFactory.Op op
The key/value match operation.
-
considerValAsKey
public final boolean considerValAsKey
If this flag is set,vis treated as a key and the value is the value set for that key.
-
-
Constructor Detail
-
KeyValueCondition
public KeyValueCondition(java.lang.String k, java.lang.String v, ConditionFactory.Op op, boolean considerValAsKey)
Creates a key/value-condition.
- Parameters:
k- the keyv- the valueop- the operationconsiderValAsKey- whether to considervas another key and compare the values of keykand keyv.
-
-
Method Detail
-
requiresExactKeyMatch
public boolean requiresExactKeyMatch()
Determines if this condition requires an exact key match.- Returns:
trueif this condition requires an exact key match.- Since:
- 14801
-
applies
public boolean applies(Tagged osm)
Description copied from interface:ConditionChecks if the condition applies in the givenTaggedelement.- Specified by:
appliesin interfaceCondition- Specified by:
appliesin interfaceCondition.TagCondition- Parameters:
osm- The tagged to check.- Returns:
trueif the condition applies.
-
asTag
public Tag asTag(Tagged primitive)
Description copied from interface:Condition.TagConditionConverts the current condition to a tag- Specified by:
asTagin interfaceCondition.TagCondition- Parameters:
primitive- A tagged object to use as context. May be ignored.- Returns:
- A tag with the key/value of this condition.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-