Class Query<TData, TPayload> | Quick Search | 2.0.0
docs.unity3d.com
    Show / Hide Table of Contents

    Class Query<TData, TPayload>

    A Query defines an operation that can be used to filter a data set.

    Inheritance
    Object
    Query<TData, TPayload>
    Query<T>
    Namespace: Unity.QuickSearch
    Syntax
    public class Query<TData, TPayload>
        where TPayload : class
    Type Parameters
    Name Description
    TData

    The filtered data type.

    TPayload

    The payload type.

    Properties

    errors

    List of QueryErrors.

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

    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.

    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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023