Class ConditionFactory.SimpleKeyValueCondition
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.SimpleKeyValueCondition
-
- All Implemented Interfaces:
Condition,Condition.TagCondition
- Enclosing class:
- ConditionFactory
public static class ConditionFactory.SimpleKeyValueCondition extends java.lang.Object implements Condition.TagCondition
Most common case of a KeyValueCondition, this is the basic key=value case. Extra class for performance reasons.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Condition
Condition.Context, Condition.TagCondition
-
-
Constructor Summary
Constructors Constructor Description SimpleKeyValueCondition(java.lang.String k, java.lang.String v)Create a new SimpleKeyValueCondition.
-
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 tagjava.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
-
-
-
-
Constructor Detail
-
SimpleKeyValueCondition
public SimpleKeyValueCondition(java.lang.String k, java.lang.String v)
Create a new SimpleKeyValueCondition.- Parameters:
k- The keyv- The value.
-
-
Method Detail
-
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
-
-