Package sglib

Class Tools


  • public class Tools
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Tools()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void print​(double d)
      Print double value without new line
      static void print​(int i)
      Print integer value without new line
      static void print​(java.lang.String text)
      Print text without new line
      static void println()
      Print newline
      static void println​(double d)
      Print double value with new line
      static void println​(int i)
      Print integer value with new line
      static void println​(java.lang.String text)
      Print text with new line
      static int rand​(int min, int max)
      Generate a random integer number within given range.
      static java.lang.String read​(java.lang.String msg)
      Read a string from console.
      static void wait​(int msecs)
      Wait some time (given in milliseconds).
      static void waitForEnter()
      Wait for ENTER key.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Tools

        public Tools()
    • Method Detail

      • rand

        public static int rand​(int min,
                               int max)
        Generate a random integer number within given range.
        Parameters:
        min - minimum value (included)
        max - maximum value (included)
        Returns:
        random integer number
      • wait

        public static void wait​(int msecs)
        Wait some time (given in milliseconds).
        Parameters:
        msecs - time to wait in milliseconds
      • print

        public static void print​(java.lang.String text)
        Print text without new line
        Parameters:
        text -
      • print

        public static void print​(int i)
        Print integer value without new line
        Parameters:
        i -
      • print

        public static void print​(double d)
        Print double value without new line
        Parameters:
        d -
      • println

        public static void println()
        Print newline
      • println

        public static void println​(java.lang.String text)
        Print text with new line
        Parameters:
        text -
      • println

        public static void println​(int i)
        Print integer value with new line
        Parameters:
        i -
      • println

        public static void println​(double d)
        Print double value with new line
        Parameters:
        d -
      • waitForEnter

        public static void waitForEnter()
        Wait for ENTER key. Console needs focus.
      • read

        public static java.lang.String read​(java.lang.String msg)
        Read a string from console.
        Parameters:
        msg - Message displayed in console before asking for input.
        Returns:
        read string