org.crsh.term
Interface Term

All Superinterfaces:
Closeable, Flushable, Pipe<Chunk>
All Known Implementing Classes:
ConsoleTerm

public interface Term
extends Closeable, Pipe<Chunk>


Method Summary
 void addToHistory(CharSequence line)
          Append a line to the term history.
 void close()
          Close the term.
 void flush()
          Flush the term buffer.
 CharSequence getBuffer()
          Returns the current buffer content to the cursor;
 Appendable getDirectBuffer()
          Returns the direct buffer, any char appended in the returned appendable will translate into an insertion in the buffer.
 int getHeight()
          Returns the term height in chars.
 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.
 
Methods inherited from interface org.crsh.io.Pipe
provide
 

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

getHeight

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

Returns:
the term height

getProperty

String getProperty(String name)
Retrieves the value of a property specified by this Term

Parameters:
name - name of the term property
Returns:
value of the term property

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

getDirectBuffer

Appendable getDirectBuffer()
Returns the direct buffer, any char appended in the returned appendable will translate into an insertion in the buffer.

Returns:
the insert buffer.

getBuffer

CharSequence getBuffer()
Returns the current buffer content to the cursor;

Returns:
the buffer

addToHistory

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

Parameters:
line - the history line to append

flush

void flush()
Flush the term buffer.

Specified by:
flush in interface Flushable

close

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

Specified by:
close in interface Closeable


Copyright © 2013 eXo Platform SAS. All Rights Reserved.