Enum MatchType
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
匹配类型
枚举,用于说明应如何匹配字符串值。匹配字符串是一项布尔运算。给定字符串、匹配字词(字符串)和匹配类型,在以下情况下,该运算会输出 true
:
- 如果匹配类型为完全匹配,并且匹配字词与字符串相等。
- 如果匹配类型等于 PREFIX,并且匹配字词是字符串的前缀。
- 如果匹配类型为“任意”,并且匹配字词是字符串的子字符串。
此枚举可由字符串过滤条件控件使用,以决定要从数据表中滤除哪些行。指定要过滤的列后,使用上述某种匹配类型,仅保留与过滤条件输入框中输入的值匹配的行。
如需调用枚举,您可以调用其父类、名称和属性。例如
Charts.MatchType.EXACT
。
属性
属性 | 类型 | 说明 |
EXACT | Enum | 仅匹配完全匹配的值 |
PREFIX | Enum | 从值开头匹配前缀 |
ANY | Enum | 匹配任何子字符串 |
方法
方法 | 返回类型 | 简介 |
getName() | String | 返回要在选项 JSON 中使用的匹配类型的名称。 |
详细文档
getName()
返回要在选项 JSON 中使用的匹配类型的名称。
返回
String
- 类型的名称。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eMatchType\u003c/code\u003e is an enumeration used to define how a string value should be matched against a given search term.\u003c/p\u003e\n"],["\u003cp\u003eIt provides three options: \u003ccode\u003eEXACT\u003c/code\u003e, \u003ccode\u003ePREFIX\u003c/code\u003e, and \u003ccode\u003eANY\u003c/code\u003e for matching exact values, prefixes, and substrings respectively.\u003c/p\u003e\n"],["\u003cp\u003eThis enumeration can be utilized by string filter controls to filter data table rows based on user input and the selected match type.\u003c/p\u003e\n"],["\u003cp\u003eCalling a \u003ccode\u003eMatchType\u003c/code\u003e property is done using the parent class, name, and desired property, for instance, \u003ccode\u003eCharts.MatchType.EXACT\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetName()\u003c/code\u003e method is available to retrieve the name of the match type for use in JSON options.\u003c/p\u003e\n"]]],["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"],null,["# Enum MatchType\n\nMatchType\n\nAn enumeration of how a string value should be matched. Matching a string is a boolean operation.\nGiven a string, a match term (string), and a match type, the operation outputs `true` in\nthe following cases:\n\n1. If the match type equals EXACT and the match term equals the string.\n2. If the match type equals PREFIX and the match term is a prefix of the string.\n3. If the match type equals ANY and the match term is a substring of the string.\n\nThis enumeration can be used in by a string filter control to decide which rows to filter out\nof the data table. Given a column to filter on, leave only the rows that match the value entered\nin the filter input box, using one of the above matching types.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCharts.MatchType.EXACT`. \n\n### Properties\n\n| Property | Type | Description |\n|----------|--------|---------------------------------------------------------|\n| `EXACT` | `Enum` | Match exact values only |\n| `PREFIX` | `Enum` | Match prefixes starting from the beginning of the value |\n| `ANY` | `Enum` | Match any substring |\n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------|-------------|--------------------------------------------------------------------|\n| [getName()](#getName()) | `String` | Returns the name of the match type to be used in the options JSON. |\n\nDetailed documentation\n----------------------\n\n### `get``Name()`\n\nReturns the name of the match type to be used in the options JSON.\n\n#### Return\n\n\n`String` --- The name of the type."]]