All Known Subinterfaces:
BButton, BButtonRC, BDebounce, BDebounceRC
All Known Implementing Classes:
BButton.Both, BButton.Pressed, BButton.Released, BButtonRC.Both, BButtonRC.Pressed, BButtonRC.Released, BDebounce.Both, BDebounce.Falling, BDebounce.Rising, BDebounceRC.Both, BDebounceRC.Falling, BDebounceRC.Rising, BFilterGroup

public interface BFilter
This is the BFilter interface class that gives a definition for how to implement a filter.

All that a BFilter does is take in the next boolean in a stream and gives you the filtered value.

  • Method Summary

    Modifier and Type
    Method
    Description
    default BFilter
    and(BFilter other)
    Combine two BFilters by and'ing their results together
    static BFilter
    create(BFilter... filters)
    Create a BFilter from a list of BFilters.
    boolean
    get(boolean next)
    Get next value in Filter based on the next value given
    default BFilter
    or(BFilter other)
    Combine two BFilters by or'ing their results together
    default BFilter
    then(BFilter next)
    Combine an BFilter with another BFilter
    default BFilter
    xor(BFilter other)
    Combine two BFilters by xor'ing their results together
  • Method Details

    • create

      static BFilter create(BFilter... filters)
      Create a BFilter from a list of BFilters. This will create a BFilter with the least possible overhead for the number of filters provided.
      Parameters:
      filters - list of BFilters to apply
      Returns:
      an BFilter that uses every filter given
    • get

      boolean get(boolean next)
      Get next value in Filter based on the next value given
      Parameters:
      next - next input value in the stream
      Returns:
      the output value of the filter
    • then

      default BFilter then(BFilter next)
      Combine an BFilter with another BFilter
      Parameters:
      next - filter to be evaluated after this one
      Returns:
      the combined filter
    • and

      default BFilter and(BFilter other)
      Combine two BFilters by and'ing their results together
      Parameters:
      other - other BFilter to and with this one
      Returns:
      the resulting BFilter after the and
    • or

      default BFilter or(BFilter other)
      Combine two BFilters by or'ing their results together
      Parameters:
      other - other BFilter to or with this one
      Returns:
      the resulting BFilter after the or
    • xor

      default BFilter xor(BFilter other)
      Combine two BFilters by xor'ing their results together
      Parameters:
      other - other BFilter to xor with this one
      Returns:
      the resulting BFilter after the xor