Skip to content

Filters

omarathon edited this page Aug 9, 2019 · 10 revisions

Overview

Filters are essential to controlling the movement of the crawler through Matches and Summoners, as well as in restricting the data sent to an OutputHandler.

There are two main filters:

  • SummonerFilter - Filters an Orianna core Summoner object.
  • MatchFilter - Filters an Orianna core Match object.

Both SummonerFilters and MatchFilters are GhostFilters. A GhostFilter is a MemorisingFilter, which overrides the MemorisingFilter's apply method to firstly check whether the incoming GhostObject exists. If not, it's instantly rejected by the filter, otherwise the filter proceeds to be applied.

Usage

One may define their own Filter by implementing its filter method, predicating the input object of the filter's type.

Since SummonerFilter and MatchFilter both only have their filter method unimplemented, it's the only method one must implement to obtain a fully functioning filter.

Examples

Below is an example for constructing your own SummonerFilter:

public class ExampleFilter extends SummonerFilter {
    public boolean filter(Summoner s) {
        // predicate the input Summoner here
    }
}

and similarly constructing your own MatchFilter:

public class ExampleFilter extends MatchFilter {
    public boolean filter(Match m) {
        // predicate the input Match here
    }
}

Presets

Contained within presets/summonerfilters and presets/matchfilters, one may find preset SummonerFilters and MatchFilters.

Preset SummonerFilters

  • AllowAllSummonerFilter - simply returns true in the predicate for the SummonerFilter - accepts any input Summoner.
  • LevelSummonerFilter - accepts all Summoners that are level 30 and above, and rejects all Summoners below level 30.
  • EloSummonerFilter - predicates Summoners based upon whether their Rank obtained from a SummonerEloEstimator belongs to a set of input "allowed" ranks. If it does, the Summoner is accepted by the filter, otherwise it's rejected. Refer to Estimators wiki page for more information on SummonerEloEstimators.
Clone this wiki locally