index.md 2.57 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[android-components](../../index.md) / [mozilla.components.browser.engine.system.matcher](../index.md) / [Trie](./index.md)

# Trie

`open class Trie` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/matcher/Trie.kt#L12)

Simple implementation of a Trie, used for indexing URLs.

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `Trie(character: `[`Char`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html)`, parent: `[`Trie`](./index.md)`?)`<br>Simple implementation of a Trie, used for indexing URLs. |

### Properties

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
19
| [children](children.md) | `val children: <ERROR CLASS>` |
20
21
22
23
24
25
26
27
28
29
30
31
32
33

### Functions

| Name | Summary |
|---|---|
| [createNode](create-node.md) | `open fun createNode(character: `[`Char`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html)`, parent: `[`Trie`](./index.md)`): `[`Trie`](./index.md)<br>Creates a new node for the provided character and parent node. |
| [findNode](find-node.md) | `fun findNode(string: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Trie`](./index.md)`?`<br>`fun findNode(string: `[`ReversibleString`](../-reversible-string/index.md)`): `[`Trie`](./index.md)`?`<br>Finds the node corresponding to the provided string. |
| [put](put.md) | `fun put(string: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Trie`](./index.md)<br>`fun put(string: `[`ReversibleString`](../-reversible-string/index.md)`): `[`Trie`](./index.md)<br>Adds new nodes (recursively) for all chars in the provided string.`fun put(character: `[`Char`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html)`): `[`Trie`](./index.md)<br>Adds a new node for the provided character if none exists. |

### Companion Object Functions

| Name | Summary |
|---|---|
| [createRootNode](create-root-node.md) | `fun createRootNode(): `[`Trie`](./index.md)<br>Creates a new root node. |
MickeyMoz's avatar
MickeyMoz committed
34
35
36
37
38
39

### Extension Functions

| Name | Summary |
|---|---|
| [loadResourceAsString](../../mozilla.components.support.test.file/kotlin.-any/load-resource-as-string.md) | `fun `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`.loadResourceAsString(path: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Loads a file from the resources folder and returns its content as a string object. |