Class SearchSetting
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.search.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 booleanallElementstrueto include all objects (even incomplete and deleted ones)booleancaseSensitivetrueto perform a case-sensitive searchbooleanmapCSSSearchtrueto execute a MapCSS selectorSearchModemodeSearch modebooleanregexSearchtrueto perform a regex-based searchjava.lang.StringtextSearch text
-
Constructor Summary
Constructors Constructor Description SearchSetting()Constructs a newSearchSetting.SearchSetting(SearchSetting original)Constructs a newSearchSettingfrom an existing one.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)static SearchSettingfromString(java.lang.String s)Build a SearchSetting from a plain unformatted string.inthashCode()static SearchSettingreadFromString(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, seeSearchMode, the second defines a set of attributes within theSearchSettingclass and the second is the search query.java.lang.StringtoString()java.lang.StringtoStringEx()A more talkative version of toString.java.lang.StringwriteToString()Builds a string representation of theSearchSettingobject, seereadFromString(String)for more details.
-
-
-
Field Detail
-
text
public java.lang.String text
Search text
-
mode
public SearchMode mode
Search mode
-
caseSensitive
public boolean caseSensitive
trueto perform a case-sensitive search
-
regexSearch
public boolean regexSearch
trueto perform a regex-based search
-
mapCSSSearch
public boolean mapCSSSearch
trueto execute a MapCSS selector
-
allElements
public boolean allElements
trueto include all objects (even incomplete and deleted ones)
-
-
Constructor Detail
-
SearchSetting
public SearchSetting()
Constructs a newSearchSetting.
-
SearchSetting
public SearchSetting(SearchSetting original)
Constructs a newSearchSettingfrom an existing one.- Parameters:
original- original search settings
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.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 theSearchSettingclass 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 aSearchSettingobject from which the object must be built.- Returns:
- A
SearchSettingdefined 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 theSearchSettingobject, seereadFromString(String)for more details.- Returns:
- A string representation of the
SearchSettingobject.
-
-