Interface IStream
- All Superinterfaces:
DoubleSupplier
- All Known Implementing Classes:
FilteredIStream
,NumberStream
,PollingIStream
,SmartNumber
A stream of doubles that is accessed with the
get()
function
Can be created with lambdas to represent a stream of inputs.
It can be filitered with the available filtering options.
-
Method Summary
Modifier and TypeMethodDescriptiondefault IStream
Combine two IStreams by adding their results togetherstatic IStream
Create an IStream from another AStream.static IStream
Create a IStream from another BStream.static IStream
Create an IStream from another IStream.default FilteredIStream
Create a new FilteredIStream from the current streamdouble
get()
default double
default NumberStream
number()
Casts an IStream to a Numberdefault PollingIStream
polling
(double dt) Create a new PollingIStream from the current streamdefault IStream
Combine two IStreams by subtracting their results together
-
Method Details
-
create
Create an IStream from another IStream. This is helpful if you want to use some of the decorator functions with a lambda.- Parameters:
stream
- stream to create IStream from- Returns:
- the resulting IStream
-
create
Create an IStream from another AStream. This will convert the angle to a double in radians.- Parameters:
stream
- stream to create IStream from- Returns:
- the resulting IStream
-
create
Create a IStream from another BStream. This will check if the amplitude is above a certain threshold.- Parameters:
stream
- stream to create IStream from- Returns:
- the resulting IStream
-
get
double get()- Returns:
- next value in the stream
-
getAsDouble
default double getAsDouble()- Specified by:
getAsDouble
in interfaceDoubleSupplier
- Returns:
- get IStream as a double
-
filtered
Create a new FilteredIStream from the current stream- Parameters:
filters
- the filters you want to apply to the IStream- Returns:
- The FilteredIStream
-
polling
Create a new PollingIStream from the current stream- Parameters:
dt
- the time inbetween each poll of the IStream- Returns:
- The PollingIStream
-
add
Combine two IStreams by adding their results together- Parameters:
other
- other IStream to add to this one- Returns:
- the resulting IStream after the sum
-
sub
Combine two IStreams by subtracting their results together- Parameters:
other
- other IStream to subtract from this one- Returns:
- the resulting IStream after the subtraction
-
number
Casts an IStream to a Number- Returns:
- a Number that reads from this stream
-