Skip to content

Commit

Permalink
Add a bit of javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Nov 4, 2016
1 parent c994055 commit f44de2e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/jline/terminal/Terminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
import org.jline.utils.InfoCmp.Capability;
import org.jline.utils.NonBlockingReader;

/**
* A terminal representing a virtual terminal on the computer.
*
* Terminals should be closed by calling the {@link #close()} method
* in order to restore their original state.
*/
public interface Terminal extends Closeable, Flushable {

String getName();
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/org/jline/terminal/TerminalBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,26 @@
import org.jline.utils.Log;
import org.jline.utils.OSUtils;

/**
* Builder class to create terminals.
*/
public final class TerminalBuilder {

/**
* Returns the default system terminal.
* Terminals should be closed properly using the {@link Terminal#close()}
* method in order to restore the original terminal state.
*
* This call is equivalent to:
* <code>builder().build()</code>
*/
public static Terminal terminal() throws IOException {
return builder().build();
}

/**
* Creates a new terminal builder instance.
*/
public static TerminalBuilder builder() {
return new TerminalBuilder();
}
Expand Down

0 comments on commit f44de2e

Please sign in to comment.