context.arch.interpreter
Class IDemoRecommender

java.lang.Object
  |
  +--context.arch.BaseObject
        |
        +--context.arch.interpreter.Interpreter
              |
              +--context.arch.interpreter.IDemoRecommender

public class IDemoRecommender
extends Interpreter

This class is an interpreter that converts information about a tour into possible interesting tour demos to visit. Another component (app/widget/interpreter) sends an interpret command to it with a list of visited demos and associated user interests, a list of user interests, and a complete list of possible demos and associated information (demo name, demo text description), and this interpreter returns potentially interesting demos that the user has not visited.

See Also:
Interpreter

Field Summary
static java.lang.String CLASSNAME
          Name of interpreter
static java.lang.String DEMO_NAME
          Tag for demo
static java.lang.String INTERESTS
          Tag for interests
 
Fields inherited from class context.arch.interpreter.Interpreter
DEFAULT_PORT, inAttributes, inAttributeTypes, INTERPRET, INTERPRET_REPLY, outAttributes, outAttributeTypes
 
Fields inherited from class context.arch.BaseObject
communications, EXIT_OK, handlers, ID, parser, PING, PING_REPLY, serviceHandlers
 
Constructor Summary
IDemoRecommender()
          Constructor that creates the interpreter at the default port.
IDemoRecommender(int port)
          Constructor that creates the interpreter at the given port.
 
Method Summary
protected  AttributeNameValues interpretData(AttributeNameValues data)
          This method performs the actual interpretation of this component.
static void main(java.lang.String[] argv)
          Main method to create this interpreter with port specified by command line arguments
protected  Attributes setInAttributes()
          Sets the incoming attributes for the interpreter.
protected  Attributes setOutAttributes()
          Sets the outgoing attributes for the interpreter.
 
Methods inherited from class context.arch.interpreter.Interpreter
getInAttributeType, getOutAttributeType, isInAttribute, isOutAttribute, runInterpreterMethod, runUserMethod, setInAttribute, setOutAttribute
 
Methods inherited from class context.arch.BaseObject
askInterpreter, decodeData, encodeData, executeAsynchronousWidgetService, executeSynchronousWidgetService, getHostAddress, getId, getVersion, getVersion, getWidgetAttributes, getWidgetCallbacks, getWidgetServices, pingComponent, pollWidget, putDataInWidget, queryVersion, quit, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, returnPing, runComponentMethod, runMethod, serviceResult, setId, setVersion, subscribeTo, subscribeTo, subscribeTo, subscribeTo, unsubscribeFrom, updateAndPollWidget, userCallback, userRequest, userRequest, userRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
Name of interpreter

DEMO_NAME

public static final java.lang.String DEMO_NAME
Tag for demo

INTERESTS

public static final java.lang.String INTERESTS
Tag for interests
Constructor Detail

IDemoRecommender

public IDemoRecommender()
Constructor that creates the interpreter at the default port. It sets the id of the this interpreter to CLASSNAME.

IDemoRecommender

public IDemoRecommender(int port)
Constructor that creates the interpreter at the given port. It sets the id of the this interpreter to CLASSNAME.
Method Detail

interpretData

protected AttributeNameValues interpretData(AttributeNameValues data)
This method performs the actual interpretation of this component. It takes user interest info, visited demos and associated interest level, and available demo information, and returns the names of potentially interesting demos not yet visited.
Overrides:
interpretData in class Interpreter
Parameters:
data - AttributeNameValues containing data to be interpreted
Returns:
AttributeNameValues object containing the interpreted data

setInAttributes

protected Attributes setInAttributes()
Sets the incoming attributes for the interpreter. They are: DEMO_INTERESTS, DEMOS, and INTERESTS
Overrides:
setInAttributes in class Interpreter
Returns:
the incoming attributes for this interpreter

setOutAttributes

protected Attributes setOutAttributes()
Sets the outgoing attributes for the interpreter. They are DEMO_NAME.
Overrides:
setOutAttributes in class Interpreter
Returns:
the outgoing attributes for this interpreter.

main

public static void main(java.lang.String[] argv)
Main method to create this interpreter with port specified by command line arguments