|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crsh.term.BaseTerm
public class BaseTerm
Field Summary | |
---|---|
private Console |
console
. |
private LinkedList<CharSequence> |
history
. |
private CharSequence |
historyBuffer
. |
private int |
historyCursor
. |
private TermIO |
io
. |
private org.slf4j.Logger |
log
. |
Constructor Summary | |
---|---|
BaseTerm(TermIO io)
|
Method Summary | |
---|---|
void |
addToHistory(CharSequence line)
Append a line to the term history. |
void |
close()
Close the term. |
CharSequence |
getBuffer()
Returns the current buffer; |
Appendable |
getInsertBuffer()
Returns the insert buffer, any char appended in the returned appendable will translate into an insertion in the buffer. |
String |
getProperty(String name)
Retrieves the value of a property specified by this Term |
int |
getWidth()
Returns the term width in chars. |
TermEvent |
read()
Read the next term event. |
void |
setEcho(boolean echo)
Set the echo mode on the term. |
void |
write(CharSequence msg)
Write a message on the console, the text will be appended. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final org.slf4j.Logger log
private final LinkedList<CharSequence> history
private CharSequence historyBuffer
private int historyCursor
private final TermIO io
private final Console console
Constructor Detail |
---|
public BaseTerm(TermIO io)
Method Detail |
---|
public int getWidth()
Term
getWidth
in interface Term
public String getProperty(String name)
Term
getProperty
in interface Term
name
- name of the term property
public void setEcho(boolean echo)
Term
setEcho
in interface Term
echo
- the echo modepublic TermEvent read() throws IOException
Term
read
in interface Term
IOException
- any io exceptionpublic Appendable getInsertBuffer()
Term
getInsertBuffer
in interface Term
public void addToHistory(CharSequence line)
Term
addToHistory
in interface Term
line
- the history line to appendpublic CharSequence getBuffer()
Term
getBuffer
in interface Term
public void close()
Term
Term.read()
operation, those thread should be unblocked.
close
in interface Closeable
close
in interface Term
public void write(CharSequence msg) throws IOException
Term
write
in interface Term
msg
- the message to write
IOException
- any io exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |