Class 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
      • 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<MapCSSRulegetRuleCandidates​(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