Interface BFilter
- 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 TypeMethodDescriptiondefault BFilter
Combine two BFilters by and'ing their results togetherstatic BFilter
Create a BFilter from a list of BFilters.boolean
get
(boolean next) Get next value in Filter based on the next value givendefault BFilter
Combine two BFilters by or'ing their results togetherdefault BFilter
Combine an BFilter with another BFilterdefault BFilter
Combine two BFilters by xor'ing their results together
-
Method Details
-
create
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
Combine an BFilter with another BFilter- Parameters:
next
- filter to be evaluated after this one- Returns:
- the combined filter
-
and
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
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
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
-