@ExperimentalAppSearchApi
public final class AndNode implements Node


Node that represents logical AND of nodes.

Summary

Public constructors

AndNode(@NonNull List<Node> childNodes)

Constructor for AndNode that represents logical AND over all its child nodes.

AndNode(
    @NonNull Node firstChild,
    @NonNull Node secondChild,
    @NonNull Node[] additionalChildren
)

Convenience constructor for AndNode that represents logical AND over all its child nodes and takes in a varargs of nodes.

Public methods

void
addChild(@NonNull Node childNode)

Add a child node to the end of the current list of child nodes mChildren.

@NonNull List<Node>

Get the list of nodes being logically ANDed over by this node.

void
removeChild(int index)

Remove tbe child Node at the given index from the list of child nodes.

void
setChild(int index, @NonNull Node childNode)

Replace the child node at the provided index with the provided Node.

void
setChildren(@NonNull List<Node> childNodes)

Set the nodes being logically ANDed over by this node.

Public constructors

AndNode

Added in 1.1.0-alpha06
public AndNode(@NonNull List<Node> childNodes)

Constructor for AndNode that represents logical AND over all its child nodes.

Parameters
@NonNull List<Node> childNodes

The list of Node of at least size two representing queries to be logically ANDed over.

AndNode

public AndNode(
    @NonNull Node firstChild,
    @NonNull Node secondChild,
    @NonNull Node[] additionalChildren
)

Convenience constructor for AndNode that represents logical AND over all its child nodes and takes in a varargs of nodes.

Parameters
@NonNull Node firstChild

The first node to be ANDed over, which is required.

@NonNull Node secondChild

The second node to be ANDed over, which is required.

@NonNull Node[] additionalChildren

Additional nodes to be ANDed over, which are optional.

Public methods

addChild

Added in 1.1.0-alpha06
public void addChild(@NonNull Node childNode)

Add a child node to the end of the current list of child nodes mChildren.

Parameters
@NonNull Node childNode

A Node to add to the end of the list of child nodes.

getChildren

public @NonNull List<NodegetChildren()

Get the list of nodes being logically ANDed over by this node.

removeChild

Added in 1.1.0-alpha06
public void removeChild(int index)

Remove tbe child Node at the given index from the list of child nodes.

The list of child nodes must contain at least 3 nodes to perform this operation.

setChild

Added in 1.1.0-alpha06
public void setChild(int index, @NonNull Node childNode)

Replace the child node at the provided index with the provided Node.

Parameters
int index

The index at which to replace the child node in the list of child nodes. Must be in range of the size of mChildren.

@NonNull Node childNode

The Node that is replacing the childNode at the provided index.

setChildren

Added in 1.1.0-alpha06
public void setChildren(@NonNull List<Node> childNodes)

Set the nodes being logically ANDed over by this node.

Parameters
@NonNull List<Node> childNodes

A list of Node of at least size two representing the nodes to be logically ANDed over in this node.