Class SyntaxSocket
java.lang.Object
|
+--SyntaxSocket
- public class SyntaxSocket
- extends java.lang.Object
Socket class for SyntaxDiagnose
Gets socket # from file serverConfig.txt
which must be placed in the classpath
Accepts only 1 client at a time.
Exit this program by sending "shutdown"
Constructor Summary |
SyntaxSocket()
Reads socket No. from serverConfig.txt & creates a ServerSocket
If there is no serverConfig.txt starts with default socket # 4711 |
Method Summary |
private static java.lang.String |
analyze(java.lang.String sentence)
Calls the SyntaxDiagnose interface and
Creates a String representation of the diagnosis |
static void |
main(java.lang.String[] args)
Creates a new SyntaxSocket and waits for client input.
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
_socket
private static java.net.ServerSocket _socket
_syntax
private static SyntaxSocket _syntax
_clientSocket
private static java.net.Socket _clientSocket
SyntaxSocket
public SyntaxSocket()
throws java.io.IOException
- Reads socket No. from
serverConfig.txt
& creates a ServerSocket
If there is no serverConfig.txt
starts with default socket # 4711
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Creates a new
SyntaxSocket
and waits for client input.
Accepts only 1 client at a time.
Exit this program by sending "shutdown"
analyze
private static java.lang.String analyze(java.lang.String sentence)
- Calls the
SyntaxDiagnose
interface and
Creates a String
representation of the diagnosis
- Parameters:
sentence
- user input to be analyzed- Returns:
- String representation of the diagnosis result