ComparatorNode


@ExperimentalAppSearchApi
class ComparatorNode : Node


Node that represents a numeric search expression between a property and a numeric value.

All numeric search expressions are represented by this Node by passing in a Comparator that represent one of the comparator operators available in the query language, a PropertyPath representing the property, and a numeric value to compare the property against.

This node represents comparators as defined in the Google AIP EBNF Filtering Definition.

Summary

Constants

const Int
EQUALS = 0
const Int
const Int
const Int
const Int

Public constructors

ComparatorNode(comparator: Int, propertyPath: PropertyPath, value: Long)

Construct a Node representing a numeric search expression between a property and a numeric value.

Public functions

Int

Get the @Comparator used in the comparison.

PropertyPath

Get the PropertyPath being compared.

Long

Get the numeric value being compared.

Unit
setComparator(comparator: Int)

Set the @Comparator being used to compare the PropertyPath and value.

Unit

Set the PropertyPath being compared, i.e. the left side of the comparison.

Unit
setValue(value: Long)

Set the numeric value being compared, i.e. the right side of the comparison.

Inherited functions

From androidx.appsearch.ast.Node
(Mutable)List<Node!>

Get a list of the node's child Nodes.

Constants

EQUALS

Added in 1.1.0-alpha06
const val EQUALS = 0: Int

GREATER_EQUALS

Added in 1.1.0-alpha06
const val GREATER_EQUALS = 4: Int

GREATER_THAN

Added in 1.1.0-alpha06
const val GREATER_THAN = 3: Int

LESS_EQUALS

Added in 1.1.0-alpha06
const val LESS_EQUALS = 2: Int

LESS_THAN

Added in 1.1.0-alpha06
const val LESS_THAN = 1: Int

Public constructors

ComparatorNode

Added in 1.1.0-alpha06
ComparatorNode(comparator: Int, propertyPath: PropertyPath, value: Long)

Construct a Node representing a numeric search expression between a property and a numeric value.

Parameters
comparator: Int

An IntDef representing what comparison is being made.

propertyPath: PropertyPath

A PropertyPath that is property being compared i.e. the left hand side of the comparison.

value: Long

The numeric value being compared i.e. the right hand side of the comparison.

Public functions

getComparator

Added in 1.1.0-alpha06
fun getComparator(): Int

Get the @Comparator used in the comparison.

getPropertyPath

Added in 1.1.0-alpha06
fun getPropertyPath(): PropertyPath

Get the PropertyPath being compared.

I.e. left hand side of the comparison represented by this node.

getValue

Added in 1.1.0-alpha06
fun getValue(): Long

Get the numeric value being compared.

I.e. the right hand side of the comparison represented by this node.

setComparator

Added in 1.1.0-alpha06
fun setComparator(comparator: Int): Unit

Set the @Comparator being used to compare the PropertyPath and value.

setPropertyPath

Added in 1.1.0-alpha06
fun setPropertyPath(propertyPath: PropertyPath): Unit

Set the PropertyPath being compared, i.e. the left side of the comparison.

setValue

Added in 1.1.0-alpha06
fun setValue(value: Long): Unit

Set the numeric value being compared, i.e. the right side of the comparison.