Class ClassPreloader

java.lang.Object
edu.wpi.first.util.ClassPreloader

public final class ClassPreloader
extends Object
Loads classes by name. Can be used at any time, but is most commonly used to preload classes at the start of the program to avoid unpredictable delays due to lazy classloading later in program execution.
  • Method Details

    • preload

      public static int preload​(Iterable<String> classNames)
      Loads classes from an iterable.
      Parameters:
      classNames - iterable of class names
      Returns:
      Number of classes loaded.
    • preload

      public static int preload​(String... classNames)
      Loads classes.
      Parameters:
      classNames - array of class names
      Returns:
      Number of classes loaded.
    • preload

      public static int preload​(BufferedReader reader)
      Loads classes from a buffered reader. The input is expected to be one class name per line. Blank lines and lines starting with a semicolon are ignored.
      Parameters:
      reader - Reader
      Returns:
      Number of classes loaded.
    • preload

      public static int preload​(InputStream stream)
      Loads classes from an input stream. The input is expected to be one class name per line. Blank lines and lines starting with a semicolon are ignored.
      Parameters:
      stream - input stream
      Returns:
      Number of classes loaded.
    • preloadFile

      public static int preloadFile​(String filename)
      Loads classes from a file. The input is expected to be one class name per line. Blank lines and lines starting with a semicolon are ignored.
      Parameters:
      filename - filename
      Returns:
      Number of classes loaded.