Interface IComponentSearchProvider


public interface IComponentSearchProvider
A contract for providers used by a scene to search components by queries.
  • Method Details

    • firstChild

      Returns a search provider that hierarchically traverses the component tree until it finds a component which satisfies a given matcher.
      Parameters:
      matcher - The matcher that will be applied to components
      Returns:
      The search provider
    • find

      Stream<IComponent<?>> find(IComponent<?> rootComponent, Object query)
      Searches for components using a query in the component tree defined by a root component.
      Parameters:
      query - An object representing a query (or an identifier, that depends on implementation) to be searched
      Returns:
      a stream with components, never null, may be empty if nothing was found
    • getQuery

      Object getQuery(IComponent<?> rootComponent, IComponent<?> component)
      Returns a query object representing a given component. It is expected that the provider will then be able to find this component using the query relative to rootComponent.
      Parameters:
      rootComponent - The parent of the component relative to which the query will be obtained
      component - The component for which the query will be obtained
      Returns:
      The query