Class SearchSetting

  • Direct Known Subclasses:
    Filter

    public class SearchSetting
    extends Object
    This class defines a set of parameters that is used to perform search within the search dialog.
    Since:
    12659 (extracted from SearchAction)
    • Field Detail

      • caseSensitive

        public boolean caseSensitive
        true to perform a case-sensitive search
      • regexSearch

        public boolean regexSearch
        true to perform a regex-based search
      • mapCSSSearch

        public boolean mapCSSSearch
        true to execute a MapCSS selector
      • allElements

        public boolean allElements
        true to include all objects (even incomplete and deleted ones)
    • Constructor Detail

      • SearchSetting

        public SearchSetting()
        Constructs a new SearchSetting.
      • SearchSetting

        public SearchSetting​(SearchSetting original)
        Constructs a new SearchSetting from an existing one.
        Parameters:
        original - original search settings
    • Method Detail

      • toStringEx

        public String toStringEx()
        A more talkative version of toString.
        Returns:
        a bit more info than toString
        Since:
        18173
      • readFromString

        public static SearchSetting readFromString​(String s)

        Transforms a string following a certain format, namely "[R | A | D | S][C?,R?,A?,M?] [a-zA-Z]" where the first part defines the mode of the search, see SearchMode, the second defines a set of attributes within the SearchSetting class and the second is the search query.

        Attributes are as follows:

        • C - if search is case sensitive
        • R - if the regex syntax is used
        • A - if all objects are considered
        • M - if the mapCSS syntax is used

        For example, "RC type:node" is a valid string representation of an object that replaces the current selection, is case sensitive and searches for all objects of type node.

        Parameters:
        s - A string representation of a SearchSetting object from which the object must be built.
        Returns:
        A SearchSetting defined by the input string.
      • fromString

        public static SearchSetting fromString​(String s)
        Build a SearchSetting from a plain unformatted string.

        All attributes are defaulted, only the search string is set. This function is used in OverpassQueryWizardDialog.

        Parameters:
        s - The string
        Returns:
        The instance
        Since:
        18173
      • writeToString

        public String writeToString()
        Builds a string representation of the SearchSetting object, see readFromString(String) for more details.
        Returns:
        A string representation of the SearchSetting object.