org.problets.services
Class LearnObjExplnServer

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

public class LearnObjExplnServer
extends java.lang.Object

Serves the text explanation for a given learning objective of a given topic. Uses a cache for efficiency.

Author:
Amruth Kumar

Field Summary
static java.lang.String NOT_FOUND
          String returned if the learning objective is not found
 
Constructor Summary
LearnObjExplnServer(java.lang.String inTopic)
          Creates a server that can be queried for the explanation of each learning objective in the specified topic (inTopic parameter).
 
Method Summary
 java.util.Vector getAllExplanations(boolean leafOnly)
          Returns a vector of the explanations of all the leaf or leaf+intermediate learning objectives for this topic
 java.lang.String getExplanation(java.lang.String learnObj)
          Given a learning objective, returns its explanation.
 int getNumberOfObjectives(boolean leafOnly)
          Returns the number of leaf or leaf+intermediate learning objectives available for this topic.
 java.lang.String getXMLHierarchy()
          Returns the correct knowledge model - nodes and nesting relationships in XML format
static void main(java.lang.String[] args)
          Used for local testing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_FOUND

public static final java.lang.String NOT_FOUND
String returned if the learning objective is not found

See Also:
Constant Field Values
Constructor Detail

LearnObjExplnServer

public LearnObjExplnServer(java.lang.String inTopic)
Creates a server that can be queried for the explanation of each learning objective in the specified topic (inTopic parameter).

Parameters:
inTopic - String that specifies the topic for which the explanation server is constructed
Method Detail

getExplanation

public java.lang.String getExplanation(java.lang.String learnObj)
Given a learning objective, returns its explanation.

Parameters:
learnObj - String representing the learning objective for which explanation is desired
Returns:
the explanation for the learning objective

getNumberOfObjectives

public int getNumberOfObjectives(boolean leafOnly)
Returns the number of leaf or leaf+intermediate learning objectives available for this topic.

Parameters:
leafOnly - Boolean flag that is true if only the number of leaf learning objectives is desired, and false if the number of all (leaf + intermediate) learning objectives is desired.
Returns:
Number of leaf or leaf+intermediate learning objectives available for this topic.

getAllExplanations

public java.util.Vector getAllExplanations(boolean leafOnly)
Returns a vector of the explanations of all the leaf or leaf+intermediate learning objectives for this topic

Parameters:
leafOnly - Boolean flag that is true if only the number of leaf learning objectives is desired, and false if the number of all (leaf + intermediate) learning objectives is desired.
Returns:
Vector containing explanations of all the leaf or leaf+intermediate learning objectives for this topic

getXMLHierarchy

public java.lang.String getXMLHierarchy()
Returns the correct knowledge model - nodes and nesting relationships in XML format

Returns:
String containing the correct knowledge model in XML format.

main

public static void main(java.lang.String[] args)
Used for local testing