Skip to content

Commit

Permalink
Add some javadoc for Terminal reader/writer/input/output
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jun 13, 2018
1 parent f85e27b commit cde6119
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion terminal/src/main/java/org/jline/terminal/Terminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,21 @@ interface SignalHandler {
// Input / output
//

/**
* Retrieve the <code>Reader</code> for this terminal.
* This is the standard way to read input from this terminal.
* The reader is non blocking.
*
* @return The non blocking reader
*/
NonBlockingReader reader();


/**
* Retrieve the <code>Writer</code> for this terminal.
* This is the standard way to write to this terminal.
*
* @return The writer
*/
PrintWriter writer();

/**
Expand All @@ -78,8 +91,28 @@ interface SignalHandler {
*/
Charset encoding();

/**
* Retrieve the input stream for this terminal.
* In some rare cases, there may be a need to access the
* terminal input stream directly. In the usual cases,
* use the {@link #reader()} instead.
*
* @return The input stream
*
* @see #reader()
*/
InputStream input();

/**
* Retrieve the output stream for this terminal.
* In some rare cases, there may be a need to access the
* terminal output stream directly. In the usual cases,
* use the {@link #writer()} instead.
*
* @return The output stream
*
* @see #writer();
*/
OutputStream output();

//
Expand All @@ -88,6 +121,7 @@ interface SignalHandler {

/**
* Whether this terminal supports {@link #pause()} and {@link #resume()} calls.
*
* @return whether this terminal supports {@link #pause()} and {@link #resume()} calls.
* @see #paused()
* @see #pause()
Expand All @@ -105,6 +139,7 @@ interface SignalHandler {

/**
* Stop reading the input stream and optionally wait for the underlying threads to finish.
*
* @param wait <code>true</code> to wait until the terminal is actually paused
* @throws InterruptedException if the call has been interrupted
*/
Expand Down

0 comments on commit cde6119

Please sign in to comment.