Package org.basex.util
Class ConsoleReader
- java.lang.Object
-
- org.basex.util.ConsoleReader
-
- All Implemented Interfaces:
AutoCloseable
,PasswordReader
public abstract class ConsoleReader extends Object implements AutoCloseable, PasswordReader
Console reader.- Author:
- BaseX Team 2005-23, BSD License, Dimitar Popov
-
-
Constructor Summary
Constructors Constructor Description ConsoleReader()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close()
static ConsoleReader
get()
Creates a new instance.abstract String
readLine(String prompt)
Reads next line.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.basex.core.parse.PasswordReader
password
-
-
-
-
Method Detail
-
readLine
public abstract String readLine(String prompt)
Reads next line. If no input, then the method blocks the thread.- Parameters:
prompt
- prompt- Returns:
- next line or
null
if EOF is reached
-
close
public abstract void close()
- Specified by:
close
in interfaceAutoCloseable
-
get
public static ConsoleReader get()
Creates a new instance.- Returns:
- instance of console reader
-
-