@ExperimentalAppSearchApi
class OrNode : Node


Node that represents logical OR of nodes.

Summary

Public constructors

OrNode(childNodes: (Mutable)List<Node!>)

Constructor for OrNode that represents logical OR over all its child nodes.

OrNode(
    firstChild: Node,
    secondChild: Node,
    additionalChildren: Array<Node!>
)

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

Public functions

Unit
addChild(childNode: Node)

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

Boolean
equals(o: Any!)
(Mutable)List<Node!>

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

Int

Returns the index of the first instance of the node, or -1 if the node does not exist.

Int
Boolean

Removes the given Node from the list of child nodes.

Unit
setChild(index: Int, childNode: Node)

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

Unit
setChildren(childNodes: (Mutable)List<Node!>)

Set the nodes being logically ORed over by this node.

String

Gets the string representation of OrNode.

Public constructors

OrNode

Added in 1.1.0-alpha07
OrNode(childNodes: (Mutable)List<Node!>)

Constructor for OrNode that represents logical OR over all its child nodes.

Parameters
childNodes: (Mutable)List<Node!>

The nodes representing queries to be logically ORed over.

OrNode

OrNode(
    firstChild: Node,
    secondChild: Node,
    additionalChildren: Array<Node!>
)

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

Parameters
firstChild: Node

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

secondChild: Node

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

additionalChildren: Array<Node!>

Additional nodes to be ORed over, which are optional.

Public functions

addChild

Added in 1.1.0-alpha07
fun addChild(childNode: Node): Unit

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

Parameters
childNode: Node

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

equals

fun equals(o: Any!): Boolean

getChildren

fun getChildren(): (Mutable)List<Node!>

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

getIndexOfChild

Added in 1.1.0-alpha07
fun getIndexOfChild(node: Node): Int

Returns the index of the first instance of the node, or -1 if the node does not exist.

hashCode

fun hashCode(): Int

removeChild

Added in 1.1.0-alpha07
fun removeChild(node: Node): Boolean

Removes the given Node from the list of child nodes. If multiple copies of the node exist, then the first Node that matches the provided Node will be removed. If the node does not exist, the list will be unchanged.

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

Returns
Boolean

true if the node was removed, false if the node was not removed i.e. the node was not found.

setChild

Added in 1.1.0-alpha07
fun setChild(index: Int, childNode: Node): Unit

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

Parameters
index: Int

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

childNode: Node

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

setChildren

Added in 1.1.0-alpha07
fun setChildren(childNodes: (Mutable)List<Node!>): Unit

Set the nodes being logically ORed over by this node.

Parameters
childNodes: (Mutable)List<Node!>

A list of Node representing the nodes to be logically ORed over in this node.

toString

fun toString(): String

Gets the string representation of OrNode.

The string representation of OrNode is the string representation of OrNode's child nodes joined with "OR", all surrounded by parentheses.