DocsIO API


/** @show DocsIO
* DocsIO class provides for IO with stdin, stdout in a simple manner.
* This is updated from Docs_IO which is all static stuff and exceptions handled
* One can just do i = DocsIO.readint("Enter an integer: ");
*/

public interface DocsIO{
public static void writeLine(); // writes a new line
public static void writeString(String message); // writes a string
public static void writeString(String message, int width);
// with width > 0 will pad blanks before string (right justified)
// with width < 0 will pad blanks after string (left justified)
public static void writeStringLine(String message); // combines
public static String int2String(int value); // converts int to string
public static void writeint(int value); // writes out an int
public static String int2String(int value, int width); // with with
// right justified
public static void writeint(int value, int width); // writes with width
public static void writedouble(double value); // writes double
public static String double2String(double value);
// converts double to string
public static String double2String(double value, int width);
// with width right justified
public static void writedouble(double value, int width);// writes with width
public static String double2String(double value, int width, int places);
// converts with places to right of decimal, total width right justified
public static void writedouble(double value, int width, int places);
// writes
public static char readchar(); // reads 1 character discards rest of line
public static char readchar(String prompt); // with prompt
public static String readString(); // reads one line into a string
public static String readString(String prompt); // with prompt
public static int readint(); // reads in an int
public static int readint(String prompt); // with prompt
public static int readint(String prompt, String message);
// reads int with prompt and error message
public static double readdouble(); //reads double
public static double readdouble(String prompt); // with prompt
public static double readdouble(String prompt, String message);
// reads double with prompt and error message
public static void ANSIxy(int x, int y);
// positions cursor x, y - 0 based with 0,0 at top left
// y increasing going down
public static void ANSIClearScreen(); // clears the screen
}