Flushable
AbstractProgram
, SensibleProgram
public interface Program extends Flushable
Modifier and Type | Field | Description |
---|---|---|
static int |
EXIT_FAILURE |
Exit status
1 indicating failure. |
static int |
EXIT_SUCCESS |
Exit status
0 indicating success. |
Modifier and Type | Method | Description |
---|---|---|
int |
exitStatus(Throwable t) |
Returns an exit status for the specified exception.
|
void |
flush() |
Flushes any buffered output to underlying standard I/O destinations.
|
void |
printError(Throwable t) |
Prints an error for the specified exception.
|
int |
run() |
Runs this program.
|
static final int EXIT_SUCCESS
0
indicating success.static final int EXIT_FAILURE
1
indicating failure.int run() throws Exception
Exception
- if an exceptional condition occursvoid printError(Throwable t)
The error is considered to be printed fully (e.g., flushed) when the call returns.
Clients may ignore any exception thrown by this method.
t
- the exception for which an error should be printedStandardIoException
- if an error occurs while writing to an
underlying standard I/O destinationint exitStatus(Throwable t)
Clients may ignore any exception thrown by this method.
t
- the exception for which an exit status should be returnedvoid flush()
flush
in interface Flushable
StandardIoException
- if an error occurs while flushing an
underlying standard I/O destination