org.problets.services
Class ProblemServer

java.lang.Object
  extended by org.problets.services.ProblemServer

public class ProblemServer
extends java.lang.Object

Provides the code, explanation, output and errors for a given topic and problem number

Author:
Amruth Kumar

Constructor Summary
ProblemServer()
           
 
Method Summary
static void getCodeProblem(java.lang.String topic, int numberSolvedSoFar, java.util.Vector codeText, Behavior behavior)
          Provides the code and behavior of the (n+1)th code-analysis problem on a topic.
static void getExpressionProblem(java.lang.String topic, int numberSolvedSoFar, java.util.Vector codeText, Behavior behavior)
          Provides the code and behavior of the (n+1)th expression-evaluation problem on a topic.
static void getProblem(java.lang.String topic, int numberSolvedSoFar, java.util.Vector codeText, Behavior behavior)
          Provides the code and behavior of the (n+1)th problem on a topic.
static void main(java.lang.String[] args)
          Generates the (n+1)th problem on the specified topic, and prints its code, explanation, output and errors.
static boolean setLanguage(java.lang.String inLanguage)
          Sets the language for which problems should be generated
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProblemServer

public ProblemServer()
Method Detail

getProblem

public static void getProblem(java.lang.String topic,
                              int numberSolvedSoFar,
                              java.util.Vector codeText,
                              Behavior behavior)
Provides the code and behavior of the (n+1)th problem on a topic.

Parameters:
topic - String representing the topic for which a problem is desired
numberSolvedSoFar - The number of problems that have been provided so far to the user (and should be skipped before generating the next problem)
codeText - Vector that will contain the code for the problem
behavior - Behavior object that holds the behavior of the problem

getCodeProblem

public static void getCodeProblem(java.lang.String topic,
                                  int numberSolvedSoFar,
                                  java.util.Vector codeText,
                                  Behavior behavior)
Provides the code and behavior of the (n+1)th code-analysis problem on a topic.

Parameters:
topic - String representing the topic for which a problem is desired
numberSolvedSoFar - The number of problems that have been provided so far to the user (and should be skipped before generating the next problem)
codeText - Vector that will contain the code for the problem
behavior - Behavior object that holds the behavior of the problem

getExpressionProblem

public static void getExpressionProblem(java.lang.String topic,
                                        int numberSolvedSoFar,
                                        java.util.Vector codeText,
                                        Behavior behavior)
Provides the code and behavior of the (n+1)th expression-evaluation problem on a topic.

Parameters:
topic - String representing the topic for which a problem is desired
numberSolvedSoFar - The number of problems that have been provided so far to the user (and should be skipped before generating the next problem)
codeText - Vector that will contain the code for the problem
behavior - Behavior object that holds the behavior of the problem

setLanguage

public static boolean setLanguage(java.lang.String inLanguage)
Sets the language for which problems should be generated

Parameters:
inLanguage - String representing the programming language for which problems are desired
Returns:
True if the language was successfully changed, and false otherwise (if invalid language was specified).

main

public static void main(java.lang.String[] args)
Generates the (n+1)th problem on the specified topic, and prints its code, explanation, output and errors.

Parameters:
args - Command line arguments, the first being the topic and the second being the number of problems generated so far