OrNode
@ExperimentalAppSearchApi
public final class OrNode implements Node
Node that represents logical OR of nodes.
Summary
Public constructors |
|---|
|
Constructor for |
|
Convenience constructor for |
Public methods |
|
|---|---|
void |
Add a child node to the end of the current list of child nodes |
boolean |
|
@NonNull List<Node> |
Get the list of nodes being logically ORed over by this node. |
int |
getIndexOfChild(@NonNull Node node)Returns the index of the first instance of the node, or -1 if the node does not exist. |
int |
hashCode() |
boolean |
removeChild(@NonNull Node node)Removes the given |
void |
Replace the child node at the provided index with the provided |
void |
setChildren(@NonNull List<Node> childNodes)Set the nodes being logically ORed over by this node. |
@NonNull String |
toString()Gets the string representation of |
Public constructors
OrNode
public OrNode(@NonNull List<Node> childNodes)
Constructor for OrNode that represents logical OR over all its child nodes.
Public methods
addChild
public void addChild(@NonNull Node childNode)
Add a child node to the end of the current list of child nodes mChildren.
getChildren
public @NonNull List<Node> getChildren()
Get the list of nodes being logically ORed over by this node.
getIndexOfChild
public int getIndexOfChild(@NonNull Node node)
Returns the index of the first instance of the node, or -1 if the node does not exist.
removeChild
public boolean removeChild(@NonNull Node node)
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 |
|
setChild
public void setChild(int index, @NonNull Node childNode)
Replace the child node at the provided index with the provided Node.
setChildren
public void setChildren(@NonNull List<Node> childNodes)
Set the nodes being logically ORed over by this node.