Total Complexity | 2 |
Total Lines | 11 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package org.usfirst.frc.team3695.robot.util; |
||
7 | public class Util { |
||
|
|||
8 | |||
9 | /** |
||
10 | * kind of self explanatory, but with some spice |
||
11 | * use this mainly as a get method to retrieve values the user types into the smart dash |
||
12 | * (the 'Set' part is only in case the value doesn't exist, backup is a default to use and set if it isn't there) |
||
13 | */ |
||
14 | static Preferences pref = Preferences.getInstance(); |
||
15 | public static double getAndSetDouble(String key, double backup) { |
||
16 | if(!pref.containsKey(key)) pref.putDouble(key, backup); |
||
17 | return pref.getDouble(key, backup); |
||
18 | } |
||
20 |