0.10.8-alpha
|
A few methods repeatedly used throughout the code repository examples. More...
Static Public Member Functions | |
static int | readInt () |
Reads an integer form the standard input. More... | |
static String | readLine () |
Reads a line form the standard input. More... | |
static void | pause (long milliseconds) |
Pauses the execution of the current thread for some time. More... | |
static void | waitForever () |
Enters an infinite loop. More... | |
static List< Object > | createList (Object ... elements) |
Creates a list out of a variable number of elements. More... | |
static String | print (Object o) |
Pretty-prints an object as a string. More... | |
static void | printGreeting () |
Prints a "BeepBeep 3" greeting on the standard output. More... | |
A few methods repeatedly used throughout the code repository examples.
As for Doubler, this processor was once part of the examples repository, and was used in a few code examples at the beginning of the book (before the ApplyFunction processor was introduced). However, people who were simply copy-pasting the code snippets without cloning the whole examples repository would not find this class and could not compile the example. It was hence decided to repatriate this class into the core library to make the whole thing smoother for beginners.
Apart from the code examples, we do not recommend that you use this class.
Definition at line 44 of file UtilityMethods.java.
|
static |
Creates a list out of a variable number of elements.
elements | The elements to put in the list |
Definition at line 115 of file UtilityMethods.java.
|
static |
Pauses the execution of the current thread for some time.
milliseconds | The number of milliseconds to wait before resuming the execution |
Definition at line 75 of file UtilityMethods.java.
|
static |
Pretty-prints an object as a string.
o | The object |
Definition at line 130 of file UtilityMethods.java.
|
static |
Prints a "BeepBeep 3" greeting on the standard output.
Definition at line 167 of file UtilityMethods.java.
|
static |
Reads an integer form the standard input.
Definition at line 50 of file UtilityMethods.java.
|
static |
Reads a line form the standard input.
Definition at line 62 of file UtilityMethods.java.
|
static |
Enters an infinite loop.
This is used in some example programs where a thread is started in the background, and the main program has to remain idle. The only way to stop this method is for the program to be interrupted by some other external means (e.g. pressing Ctrl+C at the console, closing a window, etc.).
Definition at line 95 of file UtilityMethods.java.