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 boolean
applies(Tagged osm)
Checks if the condition applies in the givenTagged
element.Tag
asTag(Tagged primitive)
Converts the current condition to a tagjava.lang.String
toString()
-
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:Condition
Checks if the condition applies in the givenTagged
element.- Specified by:
applies
in interfaceCondition
- Specified by:
applies
in interfaceCondition.TagCondition
- Parameters:
osm
- The tagged to check.- Returns:
true
if the condition applies.
-
asTag
public Tag asTag(Tagged primitive)
Description copied from interface:Condition.TagCondition
Converts the current condition to a tag- Specified by:
asTag
in 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:
toString
in classjava.lang.Object
-
-