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 boolean
allElements
true
to include all objects (even incomplete and deleted ones)boolean
caseSensitive
true
to perform a case-sensitive searchboolean
mapCSSSearch
true
to execute a MapCSS selectorSearchMode
mode
Search modeboolean
regexSearch
true
to perform a regex-based searchjava.lang.String
text
Search text
-
Constructor Summary
Constructors Constructor Description SearchSetting()
Constructs a newSearchSetting
.SearchSetting(SearchSetting original)
Constructs a newSearchSetting
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, seeSearchMode
, the second defines a set of attributes within theSearchSetting
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 theSearchSetting
object, 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
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 newSearchSetting
.
-
SearchSetting
public SearchSetting(SearchSetting original)
Constructs a newSearchSetting
from an existing one.- Parameters:
original
- original search settings
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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 theSearchSetting
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 aSearchSetting
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 theSearchSetting
object, seereadFromString(String)
for more details.- Returns:
- A string representation of the
SearchSetting
object.
-
-