Interface ISelector


public interface ISelector
A selector context to hold a root IComponent for seeking icomponents.
Author:
jumperchen
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends IComponent<?>>
    T
    get(int[] path)
    Returns the target icomponent by its given path if matched.
    <T extends IComponent<?>>
    T
    get(String id)
    Returns the target icomponent by its given id if matched.
    <T extends IComponent<?>>
    List<T>
    getAncestor(int[] path)
    Returns all the ancestor from top to bottom for the given path.
    <T extends IComponent<?>>
    List<T>
    Returns all the ancestor from top to bottom for the given ichild.
    <T extends IComponent<?>>
    T
    Returns the target parent.
    int[]
    Returns the target path.
  • Method Details

    • get

      <T extends IComponent<?>> T get(String id)
      Returns the target icomponent by its given id if matched.
      Parameters:
      id - the id of the icomponent for seeking
    • get

      <T extends IComponent<?>> T get(int[] path)
      Returns the target icomponent by its given path if matched.
      Parameters:
      path - the path of the icomponent for seeking
    • getAncestor

      <T extends IComponent<?>> List<T> getAncestor(int[] path)
      Returns all the ancestor from top to bottom for the given path.
      Parameters:
      path - the path of the icomponent for seeking
    • getAncestor

      <T extends IComponent<?>> List<T> getAncestor(IComponent ichild)
      Returns all the ancestor from top to bottom for the given ichild.
      Parameters:
      ichild - the icomponent for seeking
    • getParent

      <T extends IComponent<?>> T getParent(IComponent ichild)
      Returns the target parent.

      Note: If not found, null is assumed

      Parameters:
      ichild - the icomponent for seeking
    • getPath

      int[] getPath(IComponent ichild)
      Returns the target path.

      Note: If not found, null is assumed

      Parameters:
      ichild - the icomponent for seeking