|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.term.console.Console
public final class Console
This class provides an abstraction for a console. This implementation wraps the input and output of a terminal based on a bidirectional io.
Interactions between terminal and console are done though the ViewReader and ViewWriter
classes.
| Field Summary | |
|---|---|
private char[] |
buffer
. |
private int |
curAt
Cursor Position, always equal to size unless the underlying *.IO class supports editing. |
private boolean |
echoing
Whether or not we do echoing. |
private LinkedList<CharSequence> |
lines
. |
private boolean |
previousCR
Do we have a issued a CR previously? |
private ConsoleReader |
reader
. |
private int |
size
. |
private ViewReader |
viewReader
. |
private ViewWriter |
viewWriter
. |
private ConsoleWriter |
writer
. |
| Constructor Summary | |
|---|---|
Console(ViewWriter viewWriter)
|
|
| Method Summary | |
|---|---|
private void |
appendData(char c)
|
private void |
appendData(CharSequence s)
|
private int |
appendDel()
|
void |
clearBuffer()
Clears the buffer without doing any echoing. |
private void |
echo(char c)
|
private void |
echo(String s)
|
private void |
echoCRLF()
|
private void |
echoDel()
|
CharSequence |
getBuffer()
|
CharSequence |
getBufferToCursor()
|
ConsoleReader |
getReader()
Returns the console reader. |
ViewReader |
getViewReader()
|
ConsoleWriter |
getWriter()
|
boolean |
isEchoing()
|
private void |
moveLeft()
|
private void |
moveRight()
|
private int |
pop()
|
private void |
push(char c)
|
void |
setEchoing(boolean echoing)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private char[] buffer
private int size
private int curAt
size unless the underlying *.IO class supports editing.
private LinkedList<CharSequence> lines
private boolean previousCR
private boolean echoing
private final ViewWriter viewWriter
private final ViewReader viewReader
private final ConsoleReader reader
private final ConsoleWriter writer
| Constructor Detail |
|---|
public Console(ViewWriter viewWriter)
| Method Detail |
|---|
public void clearBuffer()
public CharSequence getBuffer()
public CharSequence getBufferToCursor()
public boolean isEchoing()
public void setEchoing(boolean echoing)
public ConsoleReader getReader()
public ViewReader getViewReader()
public ConsoleWriter getWriter()
private void appendData(CharSequence s)
throws IOException
IOException
private void appendData(char c)
throws IOException
IOException
private int appendDel()
throws IOException
IOException
private void moveRight()
throws IOException
IOException
private void moveLeft()
throws IOException
IOException
private void echo(char c)
throws IOException
IOException
private void echo(String s)
throws IOException
IOException
private void echoDel()
throws IOException
IOException
private void echoCRLF()
throws IOException
IOExceptionprivate int pop()
private void push(char c)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||