ctf.evaluation.simulator.responses
Class Response

java.lang.Object
  extended by ctf.evaluation.simulator.responses.Response
Direct Known Subclasses:
CommandResponse, CTFResponse, ErrorResponse, GameOverResponse, PlacementResponse, SideResponse, StateResponse, TreesResponse, VersionResponse

public class Response
extends java.lang.Object

A simulator's response to a command or query


Constructor Summary
Response(Connection connection, java.lang.String pattern)
          Constructor (does not check the response against a regex pattern).
Response(Connection connection, java.lang.String pattern, java.lang.String name)
          Constructor.
 
Method Summary
protected  java.lang.String response()
          Reconstitute the parsed response
protected  java.lang.String[] tokens()
          Get the parsed tokens
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response(Connection connection,
                java.lang.String pattern,
                java.lang.String name)
         throws java.io.IOException,
                NetworkException
Constructor.

Parameters:
connection - the connection to receive from
pattern - the pattern that the line should conform to
name - what we're expecting to receive (human-readable)
Throws:
java.io.IOException
NetworkException

Response

public Response(Connection connection,
                java.lang.String pattern)
         throws java.io.IOException,
                NetworkException
Constructor (does not check the response against a regex pattern).

Parameters:
connection - the connection to receive from
pattern - the pattern that the line should conform to
Throws:
java.io.IOException
NetworkException
Method Detail

tokens

protected java.lang.String[] tokens()
Get the parsed tokens


response

protected java.lang.String response()
Reconstitute the parsed response