Interface TokenFilter

All Known Implementing Classes:
CachingIntervalSet, ChannelFilter, MultiFilter, NewlineFilter

public interface TokenFilter
A token filter is an object that can check if given tokens should be printed or not.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    A list of the possible channels a token can have.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the token should be printed.
    Joins two arbitrary token filters into a new filter.
    default void
    Resets the filter's state.
  • Method Details

    • join

      static TokenFilter join(TokenFilter a, TokenFilter b)
      Joins two arbitrary token filters into a new filter. They may be null, regular filters or multi filters and will be joined accordingly. The returned instance is either a or b or a new multi filter containing a, b, or their contents.
      Parameters:
      a - A token filter. May be null.
      b - A token filter. May be null.
      Returns:
      The joined token filter
    • resetState

      default void resetState()
      Resets the filter's state. Does nothing by default.
    • isTokenAllowed

      boolean isTokenAllowed(Token token)
      Checks if the token should be printed.
      Parameters:
      token - The token to check
      Returns:
      true if the given token should be printed