Class SearchSetting

  • Direct Known Subclasses:
    Filter

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

      Fields 
      Modifier and Type Field Description
      boolean allElements
      true to include all objects (even incomplete and deleted ones)
      boolean caseSensitive
      true to perform a case-sensitive search
      boolean mapCSSSearch
      true to execute a MapCSS selector
      SearchMode mode
      Search mode
      boolean regexSearch
      true to perform a regex-based search
      java.lang.String text
      Search text
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchSetting()
      Constructs a new SearchSetting.
      SearchSetting​(SearchSetting original)
      Constructs a new SearchSetting from an existing one.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      static SearchSetting fromString​(java.lang.String s)
      Build a SearchSetting from a plain unformatted string.
      int hashCode()  
      static SearchSetting readFromString​(java.lang.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.
      java.lang.String toString()  
      java.lang.String toStringEx()
      A more talkative version of toString.
      java.lang.String writeToString()
      Builds a string representation of the SearchSetting object, see readFromString(String) for more details.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • text

        public java.lang.String text
        Search text
      • 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

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringEx

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

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • readFromString

        public static SearchSetting readFromString​(java.lang.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​(java.lang.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 java.lang.String writeToString()
        Builds a string representation of the SearchSetting object, see readFromString(String) for more details.
        Returns:
        A string representation of the SearchSetting object.