|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crsh.term.console.TermIOBuffer
final class TermIOBuffer
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 TermIO |
io . |
private LinkedList<CharSequence> |
lines . |
private boolean |
previousCR Do we have a issued a CR previously? |
private int |
size . |
Constructor Summary | |
---|---|
TermIOBuffer(TermIO io) |
Method Summary | |
---|---|
TermIOBuffer |
append(char c) |
TermIOBuffer |
append(CharSequence s) |
TermIOBuffer |
append(CharSequence csq, int start, int end) |
private boolean |
appendData(char c) Append a char at the current cursor position and increment the cursor position. |
private boolean |
appendData(CharSequence s, int start, int end) |
private int |
appendDel() Delete the char before the cursor. |
(package private) char |
charAt(int index) Returns a character at a specified index in the buffer. |
(package private) void |
clear() Clears the buffer without doing any echoing. |
(package private) int |
del() Delete the char under the cursor or return -1 if no char was deleted. |
private boolean |
echo(char c) |
private void |
echo(String s) |
private boolean |
echoCRLF() |
private boolean |
echoDel() |
(package private) CharSequence |
getBufferToCursor() |
(package private) int |
getCursor() Returns the current cursor position. |
(package private) int |
getSize() Returns the total number of chars in the buffer, independently of the cursor position. |
boolean |
hasNext() |
(package private) boolean |
isEchoing() |
(package private) boolean |
moveLeft() |
(package private) int |
moveLeft(int count) |
(package private) boolean |
moveRight() |
(package private) int |
moveRight(int count) |
CharSequence |
next() |
private int |
pop() Popup one char from buffer at the current cursor position. |
private boolean |
push(char c) Push one char in the buffer at the current cursor position. |
void |
remove() |
(package private) CharSequence |
replace(CharSequence s) Replace all the characters before the cursor by the provided char sequence. |
(package private) 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 TermIO io
Constructor Detail |
---|
TermIOBuffer(TermIO io)
Method Detail |
---|
void clear()
int getSize()
int getCursor()
char charAt(int index) throws IndexOutOfBoundsException
index
- the indexIndexOutOfBoundsException
- if the index is negative or larget than the sizeCharSequence getBufferToCursor()
boolean isEchoing()
void setEchoing(boolean echoing)
public boolean hasNext()
hasNext
in interface Iterator<CharSequence>
public CharSequence next()
next
in interface Iterator<CharSequence>
public void remove()
remove
in interface Iterator<CharSequence>
public TermIOBuffer append(char c) throws IOException
append
in interface Appendable
IOException
public TermIOBuffer append(CharSequence s) throws IOException
append
in interface Appendable
IOException
public TermIOBuffer append(CharSequence csq, int start, int end) throws IOException
append
in interface Appendable
IOException
CharSequence replace(CharSequence s) throws IOException
s
- the new char sequenceIOException
- any IOExceptionboolean moveRight() throws IOException
IOException
boolean moveLeft() throws IOException
IOException
int moveRight(int count) throws IOException, IllegalArgumentException
IOException
IllegalArgumentException
int moveLeft(int count) throws IOException, IllegalArgumentException
IOException
IllegalArgumentException
int del() throws IOException
IOException
- any IOExceptionprivate boolean appendData(CharSequence s, int start, int end) throws IOException
IOException
private boolean appendData(char c) throws IOException
c
- the char to appendIOException
- any IOExceptionprivate int appendDel() throws IOException
IOException
- any IOExceptionprivate boolean echo(char c) throws IOException
IOException
private void echo(String s) throws IOException
IOException
private boolean echoDel() throws IOException
IOException
private boolean echoCRLF() throws IOException
IOException
private int pop()
private boolean push(char c)
c
- the char to push
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |