org.sadun.util
Class TelnetInputStream.TelnetCommand

java.lang.Object
  extended byorg.sadun.util.TelnetInputStream.TelnetCommand
Enclosing class:
TelnetInputStream

public class TelnetInputStream.TelnetCommand
extends java.lang.Object

A Telnet command, associated to a specific TelnetInputStream.

Commands are produced by a TelnetInputStreamitself on reading.

Version:
1.0
Author:
Cristiano Sadun

Method Summary
 int getCommandCode()
          Return the telnet command code
 java.lang.String getCommandName()
          Return an human-readable description of the command code.
 int getOptionCode()
          Return the option code for the command.
 long getSequenceNumber()
          Return the order of the command as it has been read from the stream
 boolean hasOptionCode()
          Return true if the command is has an option code (DO, DONT, WILL, WONT)
 java.lang.String toString()
          Return a string representation of the command
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

hasOptionCode

public boolean hasOptionCode()
Return true if the command is has an option code (DO, DONT, WILL, WONT)

Returns:
true if the command is has an option code (DO, DONT, WILL, WONT)

getOptionCode

public int getOptionCode()
Return the option code for the command.

Returns:
the option code for the command.
Throws:
java.lang.IllegalStateException - if the command has no options

getCommandCode

public int getCommandCode()
Return the telnet command code

Returns:
the telnet command code

getCommandName

public java.lang.String getCommandName()
Return an human-readable description of the command code.

Returns:
an human-readable description of the command code.

getSequenceNumber

public long getSequenceNumber()
Return the order of the command as it has been read from the stream

Returns:
the order of the command as it has been read from the stream

toString

public java.lang.String toString()
Return a string representation of the command

Returns:
a string representation of the command