Enum MatchType
MatchType
An enumeration of how a string value should be matched. Matching a string is a boolean operation.
Given a string, a match term (string), and a match type, the operation outputs true
in
the following cases:
- If the match type equals EXACT and the match term equals the string.
- If the match type equals PREFIX and the match term is a prefix of the string.
- If the match type equals ANY and the match term is a substring of the string.
This enumeration can be used in by a string filter control to decide which rows to filter out
of the data table. Given a column to filter on, leave only the rows that match the value entered
in the filter input box, using one of the above matching types.
To call an enum, you call its parent class, name, and property. For example,
Charts.MatchType.EXACT
.
Properties
Property | Type | Description |
EXACT | Enum | Match exact values only |
PREFIX | Enum | Match prefixes starting from the beginning of the value |
ANY | Enum | Match any substring |
Methods
Method | Return type | Brief description |
getName() | String | Returns the name of the match type to be used in the options JSON. |
Detailed documentation
getName()
Returns the name of the match type to be used in the options JSON.
Return
String
— The name of the type.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.
[null,null,["Last updated 2024-12-02 UTC."],[[["`MatchType` is an enumeration used to define how a string value should be matched against a given search term."],["It provides three options: `EXACT`, `PREFIX`, and `ANY` for matching exact values, prefixes, and substrings respectively."],["This enumeration can be utilized by string filter controls to filter data table rows based on user input and the selected match type."],["Calling a `MatchType` property is done using the parent class, name, and desired property, for instance, `Charts.MatchType.EXACT`."],["The `getName()` method is available to retrieve the name of the match type for use in JSON options."]]],["MatchType defines string matching criteria. `EXACT` requires an exact string match. `PREFIX` checks if the match term is at the beginning of the string. `ANY` verifies if the match term is a substring. This determines if a row should be kept when filtering a data table. `getName()` returns the match type's name. The enum can be called using `Charts.MatchType.[property]` (e.g., `Charts.MatchType.EXACT`).\n"]]