com.otherwise.jurtle
Class Console

java.lang.Object
  extended bycom.otherwise.jurtle.Console

public class Console
extends java.lang.Object

The Console class contains an assortment of static methods for writing to and reading from the console panel (located below the display panel in the Jurtle user interface).


Method Summary
static void print(boolean b)
          Print a boolean value.
static void print(char c)
          Print a character.
static void print(double d)
          Print a double-precision floating-point number.
static void print(float f)
          Print a floating-point number.
static void print(int i)
          Print an integer.
static void print(long l)
          Print a long integer.
static void print(java.lang.Object obj)
          Print an object.
static void print(java.lang.String s)
          Print a string.
static void println()
          Terminate the current line by writing the line separator string.
static void println(boolean x)
          Print a boolean and then terminate the line.
static void println(char x)
          Print a character and then terminate the line.
static void println(double x)
          Print a double and then terminate the line.
static void println(float x)
          Print a float and then terminate the line.
static void println(int x)
          Print an integer and then terminate the line.
static void println(long x)
          Print a long and then terminate the line.
static void println(java.lang.Object x)
          Print an Object and then terminate the line.
static void println(java.lang.String x)
          Print a String and then terminate the line.
static boolean readBoolean()
          Reads the next boolean.
static char readChar()
          Reads a character typed on the console
static double readDouble()
          Reads the next double (without validating its format).
static float readFloat()
          Reads the next float (without validating its format).
static int readInt()
          Reads the next integer (without validating its format).
static java.lang.String readLine()
          Reads a line of text from the console
static long readLong()
          Reads the next long (without validating its format).
static java.lang.String readWord()
          Skips whitespace and reads the next word (a string of consecutive non-whitespace characters up to but excluding the next space).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

print

public static void print(boolean b)
Print a boolean value.

Parameters:
b - The boolean to be printed

print

public static void print(char c)
Print a character.

Parameters:
c - The char to be printed

print

public static void print(double d)
Print a double-precision floating-point number.

Parameters:
d - The double to be printed

print

public static void print(float f)
Print a floating-point number.

Parameters:
f - The float to be printed

print

public static void print(int i)
Print an integer.

Parameters:
i - The int to be printed

print

public static void print(long l)
Print a long integer.

Parameters:
l - The long to be printed

print

public static void print(java.lang.Object obj)
Print an object.

Parameters:
obj - The Object to be printed

print

public static void print(java.lang.String s)
Print a string.

Parameters:
s - The String to be printed

println

public static void println()
Terminate the current line by writing the line separator string.


println

public static void println(boolean x)
Print a boolean and then terminate the line.

Parameters:
x - The boolean to be printed

println

public static void println(char x)
Print a character and then terminate the line.

Parameters:
x - The char to be printed.

println

public static void println(double x)
Print a double and then terminate the line.

Parameters:
x - The double to be printed.

println

public static void println(float x)
Print a float and then terminate the line.

Parameters:
x - The float to be printed.

println

public static void println(int x)
Print an integer and then terminate the line.

Parameters:
x - The int to be printed.

println

public static void println(long x)
Print a long and then terminate the line.

Parameters:
x - a The long to be printed.

println

public static void println(java.lang.Object x)
Print an Object and then terminate the line.

Parameters:
x - The Object to be printed.

println

public static void println(java.lang.String x)
Print a String and then terminate the line.

Parameters:
x - The String to be printed.

readBoolean

public static boolean readBoolean()
Reads the next boolean. After reading the boolean the method will advance to the next non-whitespace or the end of the line.

Returns:
true if the string read is "true", false otherwise.

readChar

public static char readChar()
Reads a character typed on the console

Returns:
A char holding the character typed.

readDouble

public static double readDouble()
Reads the next double (without validating its format). After reading the double the method will advance to the next non-whitespace or the end of the line.

Returns:
the number read or 0 if trying to read beyond the EOF

readFloat

public static float readFloat()
Reads the next float (without validating its format). After reading the float the method will advance to the next non-whitespace or the end of the line.

Returns:
the number read or 0 if trying to read beyond the EOF

readInt

public static int readInt()
Reads the next integer (without validating its format). After reading the int the method will advance to the next non-whitespace or the end of the line.

Returns:
the integer read or 0 if trying to read beyond the EOF

readLine

public static java.lang.String readLine()
Reads a line of text from the console

Returns:
A string holding the line of text typed.

readLong

public static long readLong()
Reads the next long (without validating its format). After reading the long the method will advance to the next non-whitespace or the end of the line.

Returns:
the number read or 0 if trying to read beyond the EOF

readWord

public static java.lang.String readWord()
Skips whitespace and reads the next word (a string of consecutive non-whitespace characters up to but excluding the next space). After reading the word the method will advance to the next non-whitespace or the end of the line.

Returns:
the read string or null if trying to read beyond the EOF