Package frc.spectrumLib
Class CachedDouble
java.lang.Object
frc.spectrumLib.CachedDouble
- All Implemented Interfaces:
edu.wpi.first.wpilibj2.command.Subsystem
,DoubleSupplier
public class CachedDouble
extends Object
implements DoubleSupplier, edu.wpi.first.wpilibj2.command.Subsystem
CachedDouble allows for a value to only be checked once per periodic loop if it is called by
multiple methods. Periodic is run first, so the value will be updated before it is used in any
Triggers or Command
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, getName, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
CachedDouble
-
-
Method Details
-
periodic
public void periodic()- Specified by:
periodic
in interfaceedu.wpi.first.wpilibj2.command.Subsystem
-
getAsDouble
public double getAsDouble()- Specified by:
getAsDouble
in interfaceDoubleSupplier
-