org.firstinspires.ftc.robotcore.external

## Class JavaUtil

- java.lang.Object
- - org.firstinspires.ftc.robotcore.external.JavaUtil

-     public class JavaUtil
      extends java.lang.Object

  A class that provides utility methods used in FTC Java code generated from blocks.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `JavaUtil.AtMode`
    `static class` | `JavaUtil.SortDirection`
    `static class` | `JavaUtil.SortType`
    `static class` | `JavaUtil.TrimMode`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `ahsvToColor(int alpha, float hue, float saturation, float value)`
    `static double` | `averageOfList(java.util.List list)`
    `static float` | `colorToHue(int color)`
    `static float` | `colorToSaturation(int color)`
    `static float` | `colorToValue(int color)`
    `static java.util.List` | `createListWith(java.lang.Object... elements)`
    `static java.util.List` | `createListWithItemRepeated(java.lang.Object element, int n)`
    `static java.lang.String` | `formatNumber(double number, int precision)`
    `static int` | `hsvToColor(float hue, float saturation, float value)`
    `static java.lang.Object` | `inListGet(java.util.List list, JavaUtil.AtMode atMode, int i, boolean remove)`
    `static java.util.List` | `inListGetSublist(java.util.List list, JavaUtil.AtMode atMode1, int i1, JavaUtil.AtMode atMode2, int i2)`
    `static void` | `inListSet(java.util.List list, JavaUtil.AtMode atMode, int i, boolean insert, java.lang.Object value)`
    `static java.lang.String` | `inTextGetLetter(java.lang.String str, JavaUtil.AtMode atMode, int i)`
    `static java.lang.String` | `inTextGetSubstring(java.lang.String str, JavaUtil.AtMode atMode1, int i1, JavaUtil.AtMode atMode2, int i2)`
    `static boolean` | `isPrime(double d)`
    `static java.util.List` | `makeListFromText(java.lang.String text, java.lang.String delimiter)`
    `static java.lang.String` | `makeTextFromList(java.util.List list, java.lang.String delimiter)`
    `static double` | `maxOfList(java.util.List list)`
    `static double` | `medianOfList(java.util.List list)`
    `static double` | `minOfList(java.util.List list)`
    `static java.util.List` | `modesOfList(java.util.List list)`
    `static int` | `randomInt(double a, double b)`
    `static java.lang.Object` | `randomItemOfList(java.util.List list)`
    `static java.util.List` | `sort(java.util.List list, JavaUtil.SortType sortType, JavaUtil.SortDirection sortDirection)`
    `static double` | `standardDeviationOfList(java.util.List list)`
    `static double` | `sumOfList(java.util.List list)`
    `static java.lang.String` | `textTrim(java.lang.String str, JavaUtil.TrimMode trimMode)`
    `static java.lang.String` | `toTitleCase(java.lang.String str)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaUtil

          public JavaUtil()

  - ### Method Detail

    - #### inTextGetLetter

          public static java.lang.String inTextGetLetter(java.lang.String str,
                                                         JavaUtil.AtMode atMode,
                                                         int i)

    - #### inTextGetSubstring

          public static java.lang.String inTextGetSubstring(java.lang.String str,
                                                            JavaUtil.AtMode atMode1,
                                                            int i1,
                                                            JavaUtil.AtMode atMode2,
                                                            int i2)

    - #### toTitleCase

          public static java.lang.String toTitleCase(java.lang.String str)

    - #### textTrim

          public static java.lang.String textTrim(java.lang.String str,
                                                  JavaUtil.TrimMode trimMode)

    - #### formatNumber

          public static java.lang.String formatNumber(double number,
                                                      int precision)

    - #### isPrime

          public static boolean isPrime(double d)

    - #### sumOfList

          public static double sumOfList(java.util.List list)

    - #### minOfList

          public static double minOfList(java.util.List list)

    - #### maxOfList

          public static double maxOfList(java.util.List list)

    - #### averageOfList

          public static double averageOfList(java.util.List list)

    - #### medianOfList

          public static double medianOfList(java.util.List list)

    - #### modesOfList

          public static java.util.List modesOfList(java.util.List list)

    - #### standardDeviationOfList

          public static double standardDeviationOfList(java.util.List list)

    - #### randomItemOfList

          public static java.lang.Object randomItemOfList(java.util.List list)

    - #### randomInt

          public static int randomInt(double a,
                                      double b)

    - #### createListWith

          public static java.util.List createListWith(java.lang.Object... elements)

    - #### createListWithItemRepeated

          public static java.util.List createListWithItemRepeated(java.lang.Object element,
                                                                  int n)

    - #### inListGet

          public static java.lang.Object inListGet(java.util.List list,
                                                   JavaUtil.AtMode atMode,
                                                   int i,
                                                   boolean remove)

    - #### inListSet

          public static void inListSet(java.util.List list,
                                       JavaUtil.AtMode atMode,
                                       int i,
                                       boolean insert,
                                       java.lang.Object value)

    - #### inListGetSublist

          public static java.util.List inListGetSublist(java.util.List list,
                                                        JavaUtil.AtMode atMode1,
                                                        int i1,
                                                        JavaUtil.AtMode atMode2,
                                                        int i2)

    - #### sort

          public static java.util.List sort(java.util.List list,
                                            JavaUtil.SortType sortType,
                                            JavaUtil.SortDirection sortDirection)

    - #### makeTextFromList

          public static java.lang.String makeTextFromList(java.util.List list,
                                                          java.lang.String delimiter)

    - #### makeListFromText

          public static java.util.List makeListFromText(java.lang.String text,
                                                        java.lang.String delimiter)

    - #### colorToHue

          public static float colorToHue(int color)

    - #### colorToSaturation

          public static float colorToSaturation(int color)

    - #### colorToValue

          public static float colorToValue(int color)

    - #### hsvToColor

          public static int hsvToColor(float hue,
                                       float saturation,
                                       float value)

    - #### ahsvToColor

          public static int ahsvToColor(int alpha,
                                        float hue,
                                        float saturation,
                                        float value)