de.webdings.tools

Class CL


public class CL
extends java.lang.Object

CL (command line) gives basic simple command line features. The "out"-methods simply print out data, while the "lineOut"-methods print out data followed by a line break. The "in*"-Methods read data from keyboard input followed by pressing of the Enter-key. CL was created to make it easy for developers to use command-line interactivity in their Java-programs.

Version:
1.0.1 26.05.2005

Author:
Stefan Thesing
Website: http://www.webdings.de

Method Summary

static float
inFloat()
static int
inInt()
static long
inLong()
static short
inShort()
static String
inString()
static boolean
inYN()
is used for simple "yes or no"-Questions.
static void
lineOut()
Prints out an empty line followed by a line break.
static void
lineOut(Object v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(String v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(boolean v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(char v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(char[] v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(double v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(float v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(int v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(long v)
Prints out the contents of v to the console, followed by a line break.
static void
lineOut(short v)
Prints out the contents of v to the console, followed by a line break.
static void
newLine()
Prints out an empty line followed by a line break.
static void
out(Object v)
Prints out the contents of v to the console.
static void
out(String v)
Prints out the contents of v to the console.
static void
out(boolean v)
Prints out the contents of v to the console.
static void
out(char v)
Prints out the contents of v to the console.
static void
out(char[] v)
Prints out the contents of v to the console.
static void
out(double v)
Prints out the contents of v to the console.
static void
out(float v)
Prints out the contents of v to the console.
static void
out(int v)
Prints out the contents of v to the console.
static void
out(long v)
Prints out the contents of v to the console.
static void
out(short v)
Prints out the contents of v to the console.

Method Details

inFloat

public static float inFloat()
            throws IOException,
                   NumberFormatException

Returns:
a float read from keyboard user input.


inInt

public static int inInt()
            throws IOException,
                   NumberFormatException

Returns:
an int read from keyboard user input.


inLong

public static long inLong()
            throws IOException,
                   NumberFormatException

Returns:
a long read from keyboard user input.


inShort

public static short inShort()
            throws IOException,
                   NumberFormatException

Returns:
a short read from keyboard user input.


inString

public static String inString()
            throws IOException

Returns:
a string read from keyboard user input.


inYN

public static boolean inYN()
            throws IOException
is used for simple "yes or no"-Questions. It reads user input and returns true for "y", "Y", "yes", "YES", "yES", "yEs", "YEs" and false for "n", "N", "no", "NO", "nO", "No".
For anything else it will output "bad argument!" and restart the method.

Returns:
true for yes and false for no


lineOut

public static void lineOut()
Prints out an empty line followed by a line break. Identical to newLine().


lineOut

public static void lineOut(Object v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(String v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(boolean v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(char v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(char[] v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(double v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(float v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(int v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(long v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


lineOut

public static void lineOut(short v)
Prints out the contents of v to the console, followed by a line break.

Parameters:
v - The variable to be given out by the program


newLine

public static void newLine()
Prints out an empty line followed by a line break. Identical to lineOut().


out

public static void out(Object v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(String v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(boolean v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(char v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(char[] v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(double v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(float v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(int v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(long v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


out

public static void out(short v)
Prints out the contents of v to the console.

Parameters:
v - The variable to be given out by the program


CL.java - Copyright (c) 2005 by Stefan Thesing

This file is part of Webdings Tools.

Webdings Tools is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Webdings Tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Webdings Tools; if not, write to the
Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA



© 2005 by Stefan Thesing;
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.