Package edu.wisc.game.util

## Class Tools

- java.lang.Object
- - edu.wisc.game.util.Tools

-     public class Tools
      extends Object

  Various methods related to generating HTML forms and their components, and processing requests sent by the web browser when those forms are filled

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Tools()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static String` | `checkbox​(String name, Object value, Object text, boolean selected)` |
    `static boolean` | `getBoolean​(jakarta.servlet.http.HttpServletRequest request, String name, boolean defVal)` |
    `static double` | `getDouble​(jakarta.servlet.http.HttpServletRequest request, String name, double defVal)` |
    `static <T extends Enum<T>> T` | `getEnum​(jakarta.servlet.http.HttpServletRequest request, Class<T> retType, String name, T defVal)` |
    `static <T extends Enum<T>> Vector<T>` | `getEnums​(jakarta.servlet.http.HttpServletRequest request, Class<T> retType, String name)` |
    `static long` | `getLong​(jakarta.servlet.http.HttpServletRequest request, String name, long defVal)` | Retrives an integer HTTP request parameter.
    `static String` | `getString​(jakarta.servlet.http.HttpServletRequest request, String name, String defVal)` |
    `static String` | `inputHidden​(String name, boolean val)` | Creates an "input type=hidden" HTML tag
    `static String` | `inputHidden​(String name, long val)` |
    `static String` | `inputHidden​(String name, String val)` |
    `static String` | `inputText​(String name)` |
    `static String` | `inputText​(String name, Object val, int size)` | Creates an 'input type=text' tag.
    `static String` | `inputTextArea​(String name, Object val, int rows, int cols)` |
    `static String` | `radio​(String name, Object value, Object text, boolean selected)` |
    `static String` | `radioOrBox​(String name, String type, Object value, Object text, boolean selected)` | Creates an HTML "input" element of the "radio" or "checkbox" type.
    `static String` | `radioOrBox​(String name, String type, Object value, Object text, boolean selected, String style)` | Creates an HTML "input" element of the "radio" or "checkbox" type.

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

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

- - ### Constructor Detail

    - #### Tools

          public Tools()

  - ### Method Detail

    - #### inputHidden

          public static String inputHidden​(String name,
                                           boolean val)

      Creates an "input type=hidden" HTML tag

    - #### inputHidden

          public static String inputHidden​(String name,
                                           long val)

    - #### inputHidden

          public static String inputHidden​(String name,
                                           String val)

    - #### inputText

          public static String inputText​(String name)

    - #### inputText

          public static String inputText​(String name,
                                         Object val,
                                         int size)

      Creates an 'input type=text' tag.
      Parameters:
        `val` - the value to display (if not null)
        `size` - 0 means default

    - #### inputTextArea

          public static String inputTextArea​(String name,
                                             Object val,
                                             int rows,
                                             int cols)

    - #### radio

          public static String radio​(String name,
                                     Object value,
                                     Object text,
                                     boolean selected)

    - #### checkbox

          public static String checkbox​(String name,
                                        Object value,
                                        Object text,
                                        boolean selected)

    - #### radioOrBox

          public static String radioOrBox​(String name,
                                          String type,
                                          Object value,
                                          Object text,
                                          boolean selected)

      Creates an HTML "input" element of the "radio" or "checkbox" type.
      Parameters:
        `type` - must be "radio" or "checkbox"

    - #### radioOrBox

          public static String radioOrBox​(String name,
                                          String type,
                                          Object value,
                                          Object text,
                                          boolean selected,
                                          String style)

      Creates an HTML "input" element of the "radio" or "checkbox" type.
      Parameters:
        `type` - must be "radio" or "checkbox"
        `style` - Is meant to control presentation. For example, in a system providing canned scripts to telephone operators, items that the user needs to read aloud may be rendered differently.

    - #### getLong

          public static long getLong​(jakarta.servlet.http.HttpServletRequest request,
                                     String name,
                                     long defVal)

      Retrives an integer HTTP request parameter. If not found in the HTTP request, also looks in the attributes (which can be used by SurveyLogicServlet in case of internal redirect)

    - #### getDouble

          public static double getDouble​(jakarta.servlet.http.HttpServletRequest request,
                                         String name,
                                         double defVal)

    - #### getBoolean

          public static boolean getBoolean​(jakarta.servlet.http.HttpServletRequest request,
                                           String name,
                                           boolean defVal)

    - #### getEnum

          public static <T extends Enum<T>> T getEnum​(jakarta.servlet.http.HttpServletRequest request,
                                                      Class<T> retType,
                                                      String name,
                                                      T defVal)

    - #### getEnums

          public static <T extends Enum<T>> Vector<T> getEnums​(jakarta.servlet.http.HttpServletRequest request,
                                                               Class<T> retType,
                                                               String name)

    - #### getString

          public static String getString​(jakarta.servlet.http.HttpServletRequest request,
                                         String name,
                                         String defVal)