Interface Scanner<S,​R>

  • Type Parameters:
    S - the type of the scanned source
    R - the type of the scan result

    public interface Scanner<S,​R>
    A component that scans elements of type S and produces a set of results of type R.

    Implementations of this interface are expected to process a source object of type S, extract or compute a set of result objects of type R, and return them in a non-null collection. Optionally, a Filter can be provided to further refine the results.

    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    Scanner
    • Method Detail

      • scan

        @Nonnull
        java.util.Set<R> scan​(S source)
                       throws java.lang.IllegalArgumentException,
                              java.lang.IllegalStateException
        Scan source to calculate result set
        Parameters:
        source - scanned source
        Returns:
        result set , non-null
        Throws:
        java.lang.IllegalArgumentException - scanned source is not legal
        java.lang.IllegalStateException - scanned source's state is not valid
      • scan

        @Nonnull
        java.util.Set<R> scan​(S source,
                              Filter<R> filter)
                       throws java.lang.IllegalArgumentException,
                              java.lang.IllegalStateException
        Scan source to calculate result set with Filter
        Parameters:
        source - scanned source
        filter - filter to accept result
        Returns:
        result set , non-null
        Throws:
        java.lang.IllegalArgumentException - scanned source is not legal
        java.lang.IllegalStateException - scanned source's state is not valid