Package ca.team3161.lib.utils.controls
Interface JoystickMode
-
- All Superinterfaces:
java.util.function.Function<java.lang.Double,java.lang.Double>
- All Known Implementing Classes:
CubedJoystickMode,DeadbandJoystickMode,InvertedJoystickMode,LinearJoystickMode,ScaledJoystickMode,SquaredJoystickMode,SquareRootedJoystickMode
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface JoystickMode extends java.util.function.Function<java.lang.Double,java.lang.Double>Interface for "Mode" objects which apply some function to a Joystick's input. Examples include squaring the raw input values from the Joystick so that, for example, a raw reading of 0.5 on the X axis will instead read out as 0.25. Implementing a JoystickMode is also how one might handle setting an input deadband on their Joysticks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description doubleadjust(double raw)Applies some transformation function to the input and returns a result.default JoystickModeandThen(JoystickMode after)default java.lang.Doubleapply(java.lang.Double value)default JoystickModecompose(JoystickMode before)
-
-
-
Method Detail
-
adjust
double adjust(double raw)
Applies some transformation function to the input and returns a result.- Parameters:
raw- the value to adjust- Returns:
- the adjusted value
-
apply
default java.lang.Double apply(java.lang.Double value)
- Specified by:
applyin interfacejava.util.function.Function<java.lang.Double,java.lang.Double>
-
compose
default JoystickMode compose(JoystickMode before)
-
andThen
default JoystickMode andThen(JoystickMode after)
-
-