Class SearchSetting
java.lang.Object
org.openstreetmap.josm.data.osm.search.SearchSetting
- Direct Known Subclasses:
Filter
This class defines a set of parameters that is used to
perform search within the search dialog.
- Since:
- 12659 (extracted from
SearchAction)
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleantrueto include all objects (even incomplete and deleted ones)booleantrueto perform a case-sensitive searchbooleantrueto execute a MapCSS selectorSearch modebooleantrueto perform a regex-based searchSearch text -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newSearchSetting.SearchSetting(SearchSetting original) Constructs a newSearchSettingfrom an existing one. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic SearchSettingfromString(String s) Build a SearchSetting from a plain unformatted string.inthashCode()static SearchSettingTransforms 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.toString()A more talkative version of toString.Builds a string representation of theSearchSettingobject, seereadFromString(String)for more details.
-
Field Details
-
text
Search text -
mode
Search mode -
caseSensitive
trueto perform a case-sensitive search -
regexSearch
trueto perform a regex-based search -
mapCSSSearch
trueto execute a MapCSS selector -
allElements
trueto include all objects (even incomplete and deleted ones)
-
-
Constructor Details
-
SearchSetting
public SearchSetting()Constructs a newSearchSetting. -
SearchSetting
Constructs a newSearchSettingfrom an existing one.- Parameters:
original- original search settings
-
-
Method Details
-
toString
-
toStringEx
A more talkative version of toString.- Returns:
- a bit more info than toString
- Since:
- 18173
-
equals
-
hashCode
-
readFromString
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
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
Builds a string representation of theSearchSettingobject, seereadFromString(String)for more details.- Returns:
- A string representation of the
SearchSettingobject.
-