org.crsh.telnet.term
Class TelnetIO

java.lang.Object
  extended by org.crsh.telnet.term.TelnetIO
All Implemented Interfaces:
Closeable, TermIO

public class TelnetIO
extends Object
implements TermIO


Field Summary
private  net.wimpi.telnetd.net.Connection conn
          .
private  net.wimpi.telnetd.io.BasicTerminalIO termIO
          .
private  boolean useAlternate
          .
 
Constructor Summary
TelnetIO(net.wimpi.telnetd.net.Connection conn)
           
 
Method Summary
 void close()
           
 void cls()
          Clear screen.
 CodeType decode(int code)
          Decode the intput value.
 void flush()
          Flush output.
 int getHeight()
          Returns the term height in chars.
 String getProperty(String name)
          Retrieves the value of a property specified by this TermIO
 int getWidth()
          Returns the term width in chars.
 boolean moveLeft()
          Move the cursor left.
 boolean moveRight(char c)
          Move the cursor right.
 int read()
          Reads an input value.
 boolean releaseAlternateBuffer()
          Release control of the alternate buffer.
 boolean takeAlternateBuffer()
          Take control of the alternate buffer.
 void write(char c)
          Write a char.
 void write(CharSequence s)
          Write a string.
 void write(Style style)
          Write a style.
 void writeCRLF()
          Write a CRLF.
 void writeDel()
          Delete the char under the cursor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

private final net.wimpi.telnetd.net.Connection conn
.


termIO

private final net.wimpi.telnetd.io.BasicTerminalIO termIO
.


useAlternate

private boolean useAlternate
.

Constructor Detail

TelnetIO

public TelnetIO(net.wimpi.telnetd.net.Connection conn)
Method Detail

read

public int read()
         throws IOException
Description copied from interface: TermIO
Reads an input value.

Specified by:
read in interface TermIO
Returns:
the value read
Throws:
IOException - any io exception

getWidth

public int getWidth()
Description copied from interface: TermIO
Returns the term width in chars. When the value is not positive it means the value could not be determined.

Specified by:
getWidth in interface TermIO
Returns:
the term width

getHeight

public int getHeight()
Description copied from interface: TermIO
Returns the term height in chars. When the value is not positive it means the value could not be determined.

Specified by:
getHeight in interface TermIO
Returns:
the term height

getProperty

public String getProperty(String name)
Description copied from interface: TermIO
Retrieves the value of a property specified by this TermIO

Specified by:
getProperty in interface TermIO
Parameters:
name - the name of the property
Returns:
value of the property

takeAlternateBuffer

public boolean takeAlternateBuffer()
                            throws IOException
Description copied from interface: TermIO
Take control of the alternate buffer. When the alternate buffer is already used nothing happens. The buffer switch should occur when then TermIO.flush() method is invoked.

Specified by:
takeAlternateBuffer in interface TermIO
Returns:
true if the alternate buffer is shown
Throws:
IOException

releaseAlternateBuffer

public boolean releaseAlternateBuffer()
                               throws IOException
Description copied from interface: TermIO
Release control of the alternate buffer. When the normal buffer is already used nothing happens. The buffer switch should occur when then TermIO.flush() method is invoked.

Specified by:
releaseAlternateBuffer in interface TermIO
Returns:
true if the usual buffer is shown
Throws:
IOException

decode

public CodeType decode(int code)
Description copied from interface: TermIO
Decode the intput value.

Specified by:
decode in interface TermIO
Parameters:
code - the code
Returns:
the input value type

close

public void close()
Specified by:
close in interface Closeable

flush

public void flush()
           throws IOException
Description copied from interface: TermIO
Flush output.

Specified by:
flush in interface TermIO
Throws:
IOException - any io exception

write

public void write(CharSequence s)
           throws IOException
Description copied from interface: TermIO
Write a string.

Specified by:
write in interface TermIO
Parameters:
s - the string to write
Throws:
IOException - any io exception

write

public void write(Style style)
           throws IOException
Description copied from interface: TermIO
Write a style.

Specified by:
write in interface TermIO
Parameters:
style - the data to write
Throws:
IOException - any io exception

write

public void write(char c)
           throws IOException
Description copied from interface: TermIO
Write a char.

Specified by:
write in interface TermIO
Parameters:
c - the char to write
Throws:
IOException - any io exception

writeDel

public void writeDel()
              throws IOException
Description copied from interface: TermIO
Delete the char under the cursor.

Specified by:
writeDel in interface TermIO
Throws:
IOException - any io exception

writeCRLF

public void writeCRLF()
               throws IOException
Description copied from interface: TermIO
Write a CRLF.

Specified by:
writeCRLF in interface TermIO
Throws:
IOException - any io exception

moveRight

public boolean moveRight(char c)
                  throws IOException
Description copied from interface: TermIO
Move the cursor right.

Specified by:
moveRight in interface TermIO
Parameters:
c - the char skipped over
Returns:
true if the cursor moved.
Throws:
IOException - any io exception

moveLeft

public boolean moveLeft()
                 throws IOException
Description copied from interface: TermIO
Move the cursor left.

Specified by:
moveLeft in interface TermIO
Returns:
true if the cursor moved
Throws:
IOException - any io exception

cls

public void cls()
         throws IOException
Description copied from interface: TermIO
Clear screen.

Specified by:
cls in interface TermIO
Throws:
IOException - any io exception


Copyright © 2014 eXo Platform SAS. All Rights Reserved.