Class MapCSSStyleIndex

java.lang.Object
org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleIndex

public final class MapCSSStyleIndex extends Object
Store indexes of MapCSSRules using MapCSSRuleIndex differentiated by base
  • Field Details

  • Constructor Details

  • Method Details

    • clear

      public void clear()
      Clear the index.

      You must own the write lock STYLE_SOURCE_LOCK when calling this method.

    • buildIndex

      public void buildIndex(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

      Get the index of rules for the given primitive.
      Parameters:
      p - the primitive
      Returns:
      index of rules for the given primitive
    • getRuleCandidates

      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