docs.unity.cn
    Show / Hide Table of Contents

    Class Query<TData, TPayload>

    Inheritance
    Object
    Query<TData, TPayload>
    Query<T>
    Namespace: UnityEditor.Search
    Syntax
    [Obsolete("Query has been deprecated. Use ParsedQuery instead.", false)]
    public class Query<TData, TPayload>
        where TPayload : class
    Type Parameters
    Name Description
    TData
    TPayload

    Properties

    errors

    List of QueryErrors.

    Declaration
    public ICollection<QueryError> errors { get; }
    Property Value
    Type Description
    ICollection<QueryError>

    evaluationGraph

    Declaration
    public QueryGraph evaluationGraph { get; }
    Property Value
    Type Description
    QueryGraph

    queryGraph

    Declaration
    public QueryGraph queryGraph { get; }
    Property Value
    Type Description
    QueryGraph

    text

    The text that generated this query.

    Declaration
    public string text { get; }
    Property Value
    Type Description
    String

    tokens

    List of tokens found in the query.

    Declaration
    public ICollection<string> tokens { get; }
    Property Value
    Type Description
    ICollection<String>

    valid

    Indicates if the query is valid or not.

    Declaration
    public bool valid { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Apply(TPayload)

    Apply the filtering on a payload.

    Declaration
    public virtual IEnumerable<TData> Apply(TPayload payload = null)
    Parameters
    Type Name Description
    TPayload payload

    The data to filter

    Returns
    Type Description
    IEnumerable<TData>

    A filtered IEnumerable.

    GetNodeAtPosition(Int32)

    Get the query node located at the specified position in the query.

    Declaration
    public IQueryNode GetNodeAtPosition(int position)
    Parameters
    Type Name Description
    Int32 position

    The position of the query node in the text.

    Returns
    Type Description
    IQueryNode

    An IQueryNode.

    Optimize(Boolean, Boolean)

    Optimize the query by optimizing the underlying filtering graph.

    Declaration
    public void Optimize(bool propagateNotToLeaves, bool swapNotToRightHandSide)
    Parameters
    Type Name Description
    Boolean propagateNotToLeaves

    Propagate "Not" operations to leaves, so only leaves can have "Not" operations as parents.

    Boolean swapNotToRightHandSide

    Swaps "Not" operations to the right hand side of combining operations (i.e. "And", "Or"). Useful if a "Not" operation is slow.

    Optimize(QueryGraphOptimizationOptions)

    Optimize the query by optimizing the underlying filtering graph.

    Declaration
    public void Optimize(QueryGraphOptimizationOptions options)
    Parameters
    Type Name Description
    QueryGraphOptimizationOptions options

    Optimization options.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, October 26, 2022
    Terms of use