org.crsh.term
Interface Term

All Known Implementing Classes:
BaseTerm, ConsoleTerm

public interface Term

An high level term abstraction.

Version:
$Revision$
Author:
Julien Viet

Method Summary
 void addToHistory(CharSequence line)
          Append a line to the term history.
 void bufferInsert(CharSequence msg)
          Insert a message on the console just after the cursor.
 void close()
          Close the term.
 CharSequence getBuffer()
          Returns the current buffer;
 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.
 

Method Detail

getWidth

int getWidth()
Returns the term width in chars. When the value is not positive it means the value could not be determined.

Returns:
the term width

setEcho

void setEcho(boolean echo)
Set the echo mode on the term.

Parameters:
echo - the echo mode

read

TermEvent read()
               throws IOException
Read the next term event. This operation is a blocking operation that blocks until data is available or until term is closed.

Returns:
the next term event
Throws:
IOException - any io exception

write

void write(CharSequence msg)
           throws IOException
Write a message on the console, the text will be appended.

Parameters:
msg - the message to write
Throws:
IOException - any io exception

bufferInsert

void bufferInsert(CharSequence msg)
                  throws IOException
Insert a message on the console just after the cursor.

Parameters:
msg - the message to insert
Throws:
IOException - any io exception

getBuffer

CharSequence getBuffer()
Returns the current buffer;

Returns:
the buffer

addToHistory

void addToHistory(CharSequence line)
Append a line to the term history.

Parameters:
line - the history line to append

close

void close()
Close the term. If threads are blocked in the read() operation, those thread should be unblocked.



Copyright © 2011 eXo Platform SAS. All Rights Reserved.