0.10.8-alpha
ca.uqac.lif.cep.UtilityMethods Class Referenceabstract

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...
 

Detailed Description

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.

Author
Sylvain Hallé
Since
0.10.6

Definition at line 44 of file UtilityMethods.java.

Member Function Documentation

◆ createList()

static List<Object> ca.uqac.lif.cep.UtilityMethods.createList ( Object ...  elements)
static

Creates a list out of a variable number of elements.

Parameters
elementsThe elements to put in the list
Returns
The list

Definition at line 115 of file UtilityMethods.java.

◆ pause()

static void ca.uqac.lif.cep.UtilityMethods.pause ( long  milliseconds)
static

Pauses the execution of the current thread for some time.

Parameters
millisecondsThe number of milliseconds to wait before resuming the execution

Definition at line 75 of file UtilityMethods.java.

◆ print()

static String ca.uqac.lif.cep.UtilityMethods.print ( Object  o)
static

Pretty-prints an object as a string.

Parameters
oThe object
Returns
The string rendition of the object

Definition at line 130 of file UtilityMethods.java.

◆ printGreeting()

static void ca.uqac.lif.cep.UtilityMethods.printGreeting ( )
static

Prints a "BeepBeep 3" greeting on the standard output.

Definition at line 167 of file UtilityMethods.java.

◆ readInt()

static int ca.uqac.lif.cep.UtilityMethods.readInt ( )
static

Reads an integer form the standard input.

Returns
An integer

Definition at line 50 of file UtilityMethods.java.

◆ readLine()

static String ca.uqac.lif.cep.UtilityMethods.readLine ( )
static

Reads a line form the standard input.

Returns
A string with the contents of the line

Definition at line 62 of file UtilityMethods.java.

◆ waitForever()

static void ca.uqac.lif.cep.UtilityMethods.waitForever ( )
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.


The documentation for this class was generated from the following file: