Class MapCSSStyleIndex
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleIndex
-
public final class MapCSSStyleIndex extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) MapCSSRuleIndex
canvasRules
rules to apply canvas properties(package private) MapCSSRuleIndex
multipolygonRules
Rules for multipolygon relations(package private) MapCSSRuleIndex
nodeRules
Rules for nodes(package private) MapCSSRuleIndex
relationRules
Rules for relations that are not multipolygon relations(package private) MapCSSRuleIndex
wayNoAreaRules
Rules for ways with tag area=no(package private) MapCSSRuleIndex
wayRules
Rules for ways without tag area=no
-
Constructor Summary
Constructors Constructor Description MapCSSStyleIndex()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildIndex(java.util.stream.Stream<MapCSSRule> ruleStream)
Builds and initializes the index.void
clear()
Clear the index.MapCSSRuleIndex
get(IPrimitive p)
Get the index of rules for the given primitive.java.util.Iterator<MapCSSRule>
getRuleCandidates(IPrimitive osm)
Get a subset of all rules that might match the primitive.private void
initIndex()
boolean
isEmpty()
Check if this index is empty.
-
-
-
Field Detail
-
nodeRules
final MapCSSRuleIndex nodeRules
Rules for nodes
-
wayRules
final MapCSSRuleIndex wayRules
Rules for ways without tag area=no
-
wayNoAreaRules
final MapCSSRuleIndex wayNoAreaRules
Rules for ways with tag area=no
-
relationRules
final MapCSSRuleIndex relationRules
Rules for relations that are not multipolygon relations
-
multipolygonRules
final MapCSSRuleIndex multipolygonRules
Rules for multipolygon relations
-
canvasRules
final MapCSSRuleIndex canvasRules
rules to apply canvas properties
-
-
Constructor Detail
-
MapCSSStyleIndex
public MapCSSStyleIndex()
-
-
Method Detail
-
clear
public void clear()
Clear the index.You must own the write lock STYLE_SOURCE_LOCK when calling this method.
-
buildIndex
public void buildIndex(java.util.stream.Stream<MapCSSRule> ruleStream)
Builds and initializes the index.You must own the write lock of STYLE_SOURCE_LOCK when calling this method.
- Parameters:
ruleStream
- the rules to index
-
initIndex
private void initIndex()
-
get
public MapCSSRuleIndex get(IPrimitive p)
Get the index of rules for the given primitive.- Parameters:
p
- the primitive- Returns:
- index of rules for the given primitive
-
getRuleCandidates
public java.util.Iterator<MapCSSRule> getRuleCandidates(IPrimitive osm)
Get a subset of all rules that might match the primitive. Rules not included in the result are guaranteed to not match this primitive.You must have a read lock of STYLE_SOURCE_LOCK when calling this method.
- Parameters:
osm
- the primitive to match- Returns:
- An iterator over possible rules in the right order.
-
isEmpty
public boolean isEmpty()
Check if this index is empty.- Returns:
- true if this index is empty.
- Since:
- 16784
-
-