# Node

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/ast/Node.java+class:androidx.appsearch.ast.Node) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
@ExperimentalAppSearchApi
public interface Node
```

<br />

Known direct subclasses [AndNode](https://developer.android.com/reference/androidx/appsearch/ast/operators/AndNode), [ComparatorNode](https://developer.android.com/reference/androidx/appsearch/ast/operators/ComparatorNode), [FunctionNode](https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode), [NegationNode](https://developer.android.com/reference/androidx/appsearch/ast/NegationNode), [OrNode](https://developer.android.com/reference/androidx/appsearch/ast/operators/OrNode), [PropertyRestrictNode](https://developer.android.com/reference/androidx/appsearch/ast/operators/PropertyRestrictNode), [TextNode](https://developer.android.com/reference/androidx/appsearch/ast/TextNode)

|---|---|
| `https://developer.android.com/reference/androidx/appsearch/ast/operators/AndNode` | `https://developer.android.com/reference/androidx/appsearch/ast/Node` that represents logical AND of nodes. |
| `https://developer.android.com/reference/androidx/appsearch/ast/operators/ComparatorNode` | `https://developer.android.com/reference/androidx/appsearch/ast/Node` that represents a numeric search expression between a property and a numeric value. |
| `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode` | `https://developer.android.com/reference/androidx/appsearch/ast/Node` that represents a function. |
| `https://developer.android.com/reference/androidx/appsearch/ast/NegationNode` | `https://developer.android.com/reference/androidx/appsearch/ast/Node` that stores a child node to be logically negated with a negative sign ("-") or 'NOT'. |
| `https://developer.android.com/reference/androidx/appsearch/ast/operators/OrNode` | `https://developer.android.com/reference/androidx/appsearch/ast/Node` that represents logical OR of nodes. |
| `https://developer.android.com/reference/androidx/appsearch/ast/operators/PropertyRestrictNode` | `https://developer.android.com/reference/androidx/appsearch/ast/Node` that represents a property restrict. |
| `https://developer.android.com/reference/androidx/appsearch/ast/TextNode` | `https://developer.android.com/reference/androidx/appsearch/ast/Node` that stores text. |

Known indirect subclasses [GetSearchStringParameterNode](https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode), [HasPropertyNode](https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode), [PropertyDefinedNode](https://developer.android.com/reference/androidx/appsearch/ast/query/PropertyDefinedNode), [SearchNode](https://developer.android.com/reference/androidx/appsearch/ast/query/SearchNode), [SemanticSearchNode](https://developer.android.com/reference/androidx/appsearch/ast/query/SemanticSearchNode)

|---|---|
| `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode` that represents the getSearchStringParameter function. |
| `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode` representing the \`hasProperty\` query function. |
| `https://developer.android.com/reference/androidx/appsearch/ast/query/PropertyDefinedNode` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode` representing the \`propertyDefined\` query function. |
| `https://developer.android.com/reference/androidx/appsearch/ast/query/SearchNode` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode` that represents the search function. |
| `https://developer.android.com/reference/androidx/appsearch/ast/query/SemanticSearchNode` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode` that represents the semanticSearch function. |

*** ** * ** ***

This is the basic Abstract Syntax Tree (AST) class. All other classes extend from this class depending on the specific node.

This API may change in response to feedback and additional changes.

## Summary

| ### Public methods |
|---|---|
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/ast/Node>` | `https://developer.android.com/reference/androidx/appsearch/ast/Node#getChildren()()` Get a list of the node's child `https://developer.android.com/reference/androidx/appsearch/ast/Node`s. |

## Public methods

### getChildren

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
default @NonNull List<Node> getChildren()
```

Get a list of the node's child `https://developer.android.com/reference/androidx/appsearch/ast/Node`s.

By default this method will return an empty list representing that the node has no child nodes.

If a node type extends this interface and has child nodes, then that class should override this implementation and return a list of nodes of size equal to the number of child nodes that node has.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/ast/Node>` | An empty list of `https://developer.android.com/reference/androidx/appsearch/ast/Node` representing the child nodes. |