Servertec
Foundation Classes
1.3.3 09/04/2005

stec.sfc.Win32
Class Console

java.lang.Object
  extended by stec.sfc.Win32.Console

public final class Console
extends java.lang.Object

Used to interface with the system console.

Since:
1.0.0 01/07/2001

Constructor Summary
Console()
           
 
Method Summary
static int getch()
          Reads a character from the console.
static int kbhit()
          Checks the console for input.
static int putch(int chr)
          Writes a character to the console.
static int ungetch(int chr)
          Pushes back the last character read from the console
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Console

public Console()
Method Detail

getch

public static final int getch()
Reads a character from the console. Road-blocks if no character is available;

Returns:
the character read.

putch

public static final int putch(int chr)
Writes a character to the console.

Parameters:
chr - the character to write.
Returns:
the character written or -1 on error.

kbhit

public static final int kbhit()
Checks the console for input.

Returns:
non-zero (0) value if a key has been pressed or 0 is a character is not available to be read.

ungetch

public static final int ungetch(int chr)
Pushes back the last character read from the console

Parameters:
chr - the character to push back.
Returns:
the character or -1 on error.

Servertec
Foundation Classes
1.3.3 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.