Package adams.core.io.console
Interface Console
-
- All Known Implementing Classes:
Basic
public interface Console
Interface for classes that allow the user to interact in the terminal.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
enterMultiLineValue(String msg)
Lets the user enter a multi-line value.String[]
enterMultipleValues(String msg)
Lets the user enter multiple values.BasePassword
enterPassword(String msg)
Lets the user enter a password.String
enterValue(String msg)
Lets the user enter a value.String
enterValue(String msg, String initial)
Lets the user enter a value.void
printlnErr(String msg)
Outputs the error message.void
printlnOut(String msg)
Outputs the message.PlaceholderDirectory
selectDirectory(String msg, PlaceholderDirectory initial)
Lets the user select a directory.PlaceholderFile[]
selectFiles(String msg, PlaceholderFile... initial)
Lets the user select files.String
selectOption(String msg, String[] options)
Lets the user select from a number of choices.String
selectOption(String msg, String[] options, String initial)
Lets the user select from a number of choices.
-
-
-
Method Detail
-
enterMultiLineValue
String enterMultiLineValue(String msg)
Lets the user enter a multi-line value.- Parameters:
msg
- the message to output before reading the input- Returns:
- the entered value, null if cancelled or failed to read input
-
enterValue
String enterValue(String msg)
Lets the user enter a value.- Parameters:
msg
- the message to output before reading the input- Returns:
- the entered value, null if cancelled or failed to read input
-
enterValue
String enterValue(String msg, String initial)
Lets the user enter a value.- Parameters:
msg
- the message to output before reading the inputinitial
- the initial value, ignored if empty or null- Returns:
- the entered value, null if cancelled or failed to read input
-
enterMultipleValues
String[] enterMultipleValues(String msg)
Lets the user enter multiple values. Empty string terminates the loop.- Parameters:
msg
- the message to output before reading the input- Returns:
- the entered value, null if cancelled or failed to read input
-
enterPassword
BasePassword enterPassword(String msg)
Lets the user enter a password.- Parameters:
msg
- the message to output before reading the input- Returns:
- the entered value, null if cancelled or failed to read input
-
selectOption
String selectOption(String msg, String[] options)
Lets the user select from a number of choices.- Parameters:
msg
- the message to output before reading the inputoptions
- the options to choose from- Returns:
- the selected option, null if cancelled or failed to read input
-
selectOption
String selectOption(String msg, String[] options, String initial)
Lets the user select from a number of choices.- Parameters:
msg
- the message to output before reading the inputoptions
- the options to choose frominitial
- the initial selection (selected if just hitting enter), null or empty string to ignore- Returns:
- the selected option, null if cancelled or failed to read input
-
selectDirectory
PlaceholderDirectory selectDirectory(String msg, PlaceholderDirectory initial)
Lets the user select a directory.- Parameters:
msg
- the message to outputinitial
- the initial directory- Returns:
- the directory, null if cancelled
-
selectFiles
PlaceholderFile[] selectFiles(String msg, PlaceholderFile... initial)
Lets the user select files.- Parameters:
msg
- the message to outputinitial
- the initial files- Returns:
- the directory, null if cancelled
-
printlnOut
void printlnOut(String msg)
Outputs the message.- Parameters:
msg
- the message to output
-
printlnErr
void printlnErr(String msg)
Outputs the error message.- Parameters:
msg
- the error message to output
-
-