|
floating point, double | floating point, float | arbitrary precision, BigDecimal | |
integer, int | long integer, long | big integer, BigInteger | |
short integer, short | byte integer, byte | character, char | |
complex number, Complex | phasor, Phasor | boolean, boolean | |
line, a String terminated by a new line return |
floating point, double | floating point, Double | floating point, float | floating point, Float | arbitrary precision, BigDecimal | |
integer, int | integer, Integer | long integer, long | long integer, Long | big integer, BigInteger | |
short integer, short | short integer, Short | byte integer, byte | byte integer, Byte | character, char | character, Character |
complex number, Complex | phasor, Phasor | boolean, boolean | boolean, Boolean | ||
a String | ErrorProp number | ComplexErrorProp number | |||
a message only |
Entering a number | Geneneral comments applying to all types |
Remove type information from the input message | public static void setTypeInfoOption(int option) |
Enter a double floating point number (double) | public static final synchronized double readDouble(String prompt) |
public static final synchronized double readDouble(String prompt, double dflt) | |
public static final synchronized double readDouble() | |
Enter a float floating point number (float) | public static final synchronized float readFloat(String prompt) |
public static final synchronized float readFloat(String prompt, float dflt) | |
public static final synchronized float readFloat() | |
Enter a BigDecimal (BigDecimal) | public static final synchronized BigDecimal readBigDecimal(String prompt) |
public static final synchronized BigDecimal readBigDecimal(String prompt, BigDecimal dflt) | |
public static final synchronized BigDecimal readBigDecimal(String prompt, double dflt) | |
public static final synchronized BigDecimal readBigDecimal(String prompt, float dflt) | |
public static final synchronized BigDecimal readBigDecimal(String prompt, long dflt) | |
public static final synchronized BigDecimal readBigDecimal(String prompt, int dflt) | |
public static final synchronized BigDecimal readBigDecimal(String prompt, String dflt) | |
public static final synchronized BigDecimal readBigDecimal() | |
Enter an integer (int) | public static final synchronized int readInt(String prompt) |
public static final synchronized int readInt(String prompt, int dflt) | |
public static final synchronized int readInt() | |
Enter a long integer (long) | public static final synchronized long readLong(String prompt) |
public static final synchronized long readLong(String prompt, long dflt) | |
public static final synchronized long readLong() | |
Enter a BigInteger (BigInteger) | public static final synchronized BigInteger readBigInteger(String prompt) |
public static final synchronized BigInteger readBigInteger(String prompt, BigInteger dflt) | |
public static final synchronized BigInteger readBigInteger(String prompt, long dflt) | |
public static final synchronized BigInteger readBigInteger(String prompt, int dflt) | |
public static final synchronized BigInteger readBigInteger(String prompt, String dflt) | |
public static final synchronized BigInteger readBigInteger() | |
Enter a short integer (short) | public static final synchronized short readShort(String prompt) |
public static final synchronized short readShort(String prompt, short dflt) | |
public static final synchronized short readShort() | |
Enter a byte integer (byte) | public static final synchronized byte readByte(String prompt) |
public static final synchronized byte readByte(String prompt, byte dflt) | |
public static final synchronized byte readByte() | |
Enter a character (char) | public static final synchronized char readChar(String prompt) |
public static final synchronized char readChar(String prompt, char dflt) | |
public static final synchronized char readChar() | |
Enter true or false (boolean) | public static final synchronized boolean readBoolean(String prompt) |
public static final synchronized boolean readBoolean(String prompt, char dflt) | |
public static final synchronized boolean readBoolean() | |
Enter a Complex number (Complex) | public static final synchronized Complex readComplex(String prompt) |
public static final synchronized Complex readComplex(String prompt, Complex dflt) | |
public static final synchronized Complex readComplex(String prompt, String dflt) | |
public static final synchronized Complex readComplex() | |
Enter a Phasor (Phasor) | public static final synchronized Phasor readPhasor(String prompt) |
public static final synchronized Phasor readPhasor(String prompt, Complex dflt) | |
public static final synchronized Phasor readCPhasor(String prompt, String dflt) | |
public static final synchronized Phasor readPhasor() | |
Enter a line of text (String) | public static final synchronized String readLine(String prompt) |
public static final synchronized String readLine(String prompt, String dflt) | |
public static final synchronized String readLine() | |
Question with a yes or no answer |
public static final synchronized boolean yesNo(String question) public static final synchronized boolean noYes(String question) |
Multiple choice dialog box |
public static final synchronized int optionBox(String headerComment, String[] queries, String boxTitles, int defaultBox) public static final synchronized int optionBox(String headerComment, String query, String boxTitles, int defaultBox) |
Display a double, Double, float, Float, BigDecimal int, Integer, long, Long, BigInteger, short, Short, byte, Byte character, Character, String, boolean, Boolean Complex, Phasor, ErrorProp or ComplexErrorProp |
public static final synchronized void show(String message, double number) public static final synchronized void show(String message, double number, int trunc) public static final synchronized void showdouble number) public static final synchronized void show(double number, int trunc) public static final synchronized void show(String message, Double number) public static final synchronized void showDouble number) public static final synchronized void show(String message, float number) public static final synchronized void show(String message, float number, int trunc) public static final synchronized void show(float number) public static final synchronized void show(float number, int trunc) public static final synchronized void show(String message, Float number) public static final synchronized void show(Float number) public static final synchronized void show(String message, BigDecimal number) public static final synchronized void show(BigDecimal number) public static final synchronized void show(String message, int number) public static final synchronized void show(int number) public static final synchronized void show(String message, Integer number) public static final synchronized void show(Integer number) public static final synchronized void show(String message, long number) public static final synchronized void show(long number) public static final synchronized void show(String message, Long number) public static final synchronized void show(Long number) public static final synchronized void show(String message, BigInteger number) public static final synchronized void show(BigInteger number) public static final synchronized void show(String message, short number) public static final synchronized void show(short number) public static final synchronized void show(String message, Short number) public static final synchronized void show(Short number) public static final synchronized void show(String message, byte number) public static final synchronized void show(byte number) public static final synchronized void show(String message, Byte number) public static final synchronized void show(Byte number) public static final synchronized void show(String message, char character) public static final synchronized void show(char character) public static final synchronized void show(String message, Character character) public static final synchronized void show(Character character) public static final synchronized void show(String message, String string) public static final synchronized void show(String message, boolean trueOrfalse) public static final synchronized void show(boolean trueOrfalse) public static final synchronized void show(String message, Boolean trueOrfalse) public static final synchronized void show(Boolean trueOrfalse) public static final synchronized void show(String message, Complex number) public static final synchronized void show(String message, Complex number, int trunc) public static final synchronized void show(Complex number) public static final synchronized void show(Complex number, int trunc) public static final synchronized void show(String message, Phasor number) public static final synchronized void show(String message, Phasor number, int trunc) public static final synchronized void show(Phasor number) public static final synchronized void show(Phasor number, int trunc) public static final synchronized void show(String message, ErrorProp number) public static final synchronized void show(String message, ErrorProp number, int trunc) public static final synchronized void show(ErrorProp number) public static final synchronized void show(ErrorProp number, int trunc) public static final synchronized void show(String message, ComplexErrorProp number) public static final synchronized void show(String message, ComplexErrorProp number, int trunc) public static final synchronized void show(ComplexErrorProp number) public static final synchronized void show(ComplexErrorProp number, int trunc) public static final synchronized void show(String message) |
End the program | public static final synchronized void.endProgram() | System.exit(0) |
import flanagan.io.Db; public class OptionBoxExample{ public static void main(String[] args){ String headerComment = "Do you wish to read"; String[] comments = {"Word files", "Excel files", "Text files", "All file types"}; String[] boxTitles = {"Word", "Excel", "Text", "All"}; int defaultBox = 3; int opt = Db.optionBox(headerComment, comments, boxTitles, defaultBox); // rest of program System.exit(0); } }which displays: