standup.joke
Class SchemaTemplatePair

java.lang.Object
  extended by standup.joke.SchemaTemplatePair

public class SchemaTemplatePair
extends Object

Defines a combination of suitable schemas and templates for joke generation.

It associates a Schema label with two sets: a set of Template labels that represent the templates available for the question text, and a set of Template labels that represent the templates available for the answer text.

Author:
Ruli Manurung

Field Summary
(package private)  List<String> aTemplateFunctors
           
(package private)  List<String> qTemplateFunctors
           
(package private)  String schemaLabel
           
 
Constructor Summary
SchemaTemplatePair(String _s, List<String> _q, List<String> _a)
           
 
Method Summary
 boolean equals(Object obj)
           
 List<String> getAnswerTemplateFunctors()
           
 List<String> getQuestionTemplateFunctors()
           
 String getSchemaLabel()
           
static SchemaTemplatePair getSTPbySchema(List<SchemaTemplatePair> stps, String schemaLabel)
          Given a List of SchemaTemplatePairs, it returns the SchemaTemplatePair that uses the Schema with label schemaLabel.
 int hashCode()
           
 boolean suitable(String schema, String question, String answer)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

schemaLabel

String schemaLabel

qTemplateFunctors

List<String> qTemplateFunctors

aTemplateFunctors

List<String> aTemplateFunctors
Constructor Detail

SchemaTemplatePair

public SchemaTemplatePair(String _s,
                          List<String> _q,
                          List<String> _a)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getSchemaLabel

public String getSchemaLabel()

getQuestionTemplateFunctors

public List<String> getQuestionTemplateFunctors()

getAnswerTemplateFunctors

public List<String> getAnswerTemplateFunctors()

suitable

public boolean suitable(String schema,
                        String question,
                        String answer)

getSTPbySchema

public static SchemaTemplatePair getSTPbySchema(List<SchemaTemplatePair> stps,
                                                String schemaLabel)
Given a List of SchemaTemplatePairs, it returns the SchemaTemplatePair that uses the Schema with label schemaLabel. Note that the List stps should only contain *1* SchemaTemplatePair that uses Schema with label schemaLabel. This is a contract that must be obeyed by all JokeTypes!


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object