Documentation of 'joptima.tests.Console' Java class
Console
joptima.tests

Class Console



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

      Constructors 
      Constructor and Description
      Console() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void printPrompt(java.lang.String prompt)
      print a prompt on the console but don't print a newline
      static double readDouble(java.lang.String prompt)
      read a floating point number from the console.
      static int readInt(java.lang.String prompt)
      read an integer from the console.
      static java.lang.String readString()
      read a string from the console.
      static java.lang.String readString(java.lang.String prompt)
      read a string from the console.
      static java.lang.String readWord()
      read a word from the console.
      • Methods inherited from class java.lang.Object

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

      • Console

        public Console()
    • Method Detail

      • printPrompt

        public static void printPrompt(java.lang.String prompt)
        print a prompt on the console but don't print a newline
        Parameters:
        prompt - the prompt string to display
      • readString

        public static java.lang.String readString()
        read a string from the console. The string is terminated by a newline
        Returns:
        the input string (without the newline)
      • readString

        public static java.lang.String readString(java.lang.String prompt)
        read a string from the console. The string is terminated by a newline
        Parameters:
        prompt - the prompt string to display
        Returns:
        the input string (without the newline)
      • readWord

        public static java.lang.String readWord()
        read a word from the console. The word is any set of characters terminated by whitespace
        Returns:
        the 'word' entered
      • readInt

        public static int readInt(java.lang.String prompt)
        read an integer from the console. The input is terminated by a newline
        Parameters:
        prompt - the prompt string to display
        Returns:
        the input value as an int
        Throws:
        java.lang.NumberFormatException - if bad input
      • readDouble

        public static double readDouble(java.lang.String prompt)
        read a floating point number from the console. The input is terminated by a newline
        Parameters:
        prompt - the prompt string to display
        Returns:
        the input value as a double
        Throws:
        java.lang.NumberFormatException - if bad input

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.