standup.joke
Class OptionsJokeGeneration

java.lang.Object
  extended by standup.profiling.Options
      extended by standup.joke.OptionsJokeGeneration
All Implemented Interfaces:
XMLizable

public class OptionsJokeGeneration
extends Options

A Options representing the various settings relating to joke generation. Currently this includes the following:

Author:
Ruli Manurung

Field Summary
private  AllowableAmbiguity allowableAmbiguity
           
private  List<String> allowedSchemaLabels
           
private  FLevel fLevel
           
private  JokeCacheBehaviour jokeCacheBehaviour
           
private  boolean noveltyCheck
           
private  double phoneticSimilarity
           
private  List<String> usedJokeTypes
           
static String XMLTAG
           
 
Constructor Summary
OptionsJokeGeneration()
           
OptionsJokeGeneration(Element rootElement)
          Constructor method where options are supplied from an appropriate XML element.
OptionsJokeGeneration(JokeCacheBehaviour jokeCacheBehaviour, FLevel fLevel, List<String> usedJokeTypes, List<String> allowedSchemaLabels, AllowableAmbiguity allowableAmbiguity, double phoneticSimilarity, boolean dupeCheck)
          Constructor method where options are supplied directly
 
Method Summary
 AllowableAmbiguity getAllowableAmbiguity()
           
 List<String> getAllowedSchemaLabels()
           
 String getDiffString(Options options)
          Returns a String that reports the difference between this instance and the given Options.
 FLevel getFLevel()
           
 OptionsGUI getGUI(Dimension size)
          Returns an instance of an appropriate OptionsGUI.
 JokeCacheBehaviour getJokeCacheBehaviour()
           
 double getPhoneticSimilarity()
           
 List<String> getUsedJokeTypeLabels()
           
 JokeTypeSet getUsedJokeTypes(JokeTypeSet master)
          This method returns a JokeTypeSet containing all the JokeTypes that are used as indicated by this profile.
 String getXMLTag()
          Returns the XML tag associated with this implementation of Options.
 boolean isNoveltyCheck()
           
private static AllowableAmbiguity parseAllowableAmbiguity(String aaString)
           
private static List<String> parseAllowedSchemas(Element aslEl)
           
private static JokeCacheBehaviour parseJokeCacheBehaviour(String jcbString)
           
private static List<String> parseUsedJokeTypes(Element ujtEl)
           
 void setAllowableAmbiguity(AllowableAmbiguity allowableAmbiguity)
           
 void setAllowedSchemaLabels(List<String> asl)
           
 void setFLevel(FLevel fl)
           
 void setJokeCacheBehaviour(JokeCacheBehaviour jokeCacheBehaviour)
           
 void setNoveltyCheck(boolean noveltyCheck)
           
 void setPhoneticSimilarity(double phoneticSimilarity)
           
 void setUsedJokeTypeLabels(List<String> types)
          This method sets the JokeTypes that are used in this profile.
 void writeXML(Writer out, String indent)
          This method writes the necessary information contained within an instance to an XML file.
 
Methods inherited from class standup.profiling.Options
isModified, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLTAG

public static final String XMLTAG
See Also:
Constant Field Values

jokeCacheBehaviour

private JokeCacheBehaviour jokeCacheBehaviour

fLevel

private FLevel fLevel

usedJokeTypes

private List<String> usedJokeTypes

allowableAmbiguity

private AllowableAmbiguity allowableAmbiguity

phoneticSimilarity

private double phoneticSimilarity

noveltyCheck

private boolean noveltyCheck

allowedSchemaLabels

private List<String> allowedSchemaLabels
Constructor Detail

OptionsJokeGeneration

public OptionsJokeGeneration(JokeCacheBehaviour jokeCacheBehaviour,
                             FLevel fLevel,
                             List<String> usedJokeTypes,
                             List<String> allowedSchemaLabels,
                             AllowableAmbiguity allowableAmbiguity,
                             double phoneticSimilarity,
                             boolean dupeCheck)
Constructor method where options are supplied directly


OptionsJokeGeneration

public OptionsJokeGeneration()
                      throws ProfileException
Throws:
ProfileException

OptionsJokeGeneration

public OptionsJokeGeneration(Element rootElement)
Constructor method where options are supplied from an appropriate XML element. Note that the given element should not be the element, but its root, i.e. a element or an element.

Method Detail

getGUI

public OptionsGUI getGUI(Dimension size)
Description copied from class: Options
Returns an instance of an appropriate OptionsGUI. The given Dimension indicates the preferred size. If given null, it will attempt to calculate a suitable size.

Specified by:
getGUI in class Options
Returns:

getJokeCacheBehaviour

public JokeCacheBehaviour getJokeCacheBehaviour()

setJokeCacheBehaviour

public void setJokeCacheBehaviour(JokeCacheBehaviour jokeCacheBehaviour)

getFLevel

public FLevel getFLevel()

setFLevel

public void setFLevel(FLevel fl)

getUsedJokeTypes

public JokeTypeSet getUsedJokeTypes(JokeTypeSet master)
This method returns a JokeTypeSet containing all the JokeTypes that are used as indicated by this profile.

Returns:

setUsedJokeTypeLabels

public void setUsedJokeTypeLabels(List<String> types)
This method sets the JokeTypes that are used in this profile. It expects a List of the used joke type labels -- it assumes the values are valid JokeType labels in the Backend, no checking is done!

Parameters:
types -

getUsedJokeTypeLabels

public List<String> getUsedJokeTypeLabels()

getAllowableAmbiguity

public AllowableAmbiguity getAllowableAmbiguity()

setAllowableAmbiguity

public void setAllowableAmbiguity(AllowableAmbiguity allowableAmbiguity)

getPhoneticSimilarity

public double getPhoneticSimilarity()

setPhoneticSimilarity

public void setPhoneticSimilarity(double phoneticSimilarity)

isNoveltyCheck

public boolean isNoveltyCheck()

setNoveltyCheck

public void setNoveltyCheck(boolean noveltyCheck)

getAllowedSchemaLabels

public List<String> getAllowedSchemaLabels()

setAllowedSchemaLabels

public void setAllowedSchemaLabels(List<String> asl)

parseUsedJokeTypes

private static List<String> parseUsedJokeTypes(Element ujtEl)

parseAllowedSchemas

private static List<String> parseAllowedSchemas(Element aslEl)

parseAllowableAmbiguity

private static AllowableAmbiguity parseAllowableAmbiguity(String aaString)

parseJokeCacheBehaviour

private static JokeCacheBehaviour parseJokeCacheBehaviour(String jcbString)

getXMLTag

public String getXMLTag()
Description copied from class: Options
Returns the XML tag associated with this implementation of Options.

Specified by:
getXMLTag in class Options
Returns:

writeXML

public void writeXML(Writer out,
                     String indent)
              throws IOException,
                     XMLException
Description copied from interface: XMLizable
This method writes the necessary information contained within an instance to an XML file.

Parameters:
out - The output stream for the XML file, which is assumed to be already opened and writable.
indent - A string to be prepended before every line written by this method. If passed appropriate white space, e.g. XMLUtils.xmlIndent, it can be used to control indentation.
Throws:
IOException
XMLException

getDiffString

public String getDiffString(Options options)
Description copied from class: Options
Returns a String that reports the difference between this instance and the given Options. Currently used by the Playback tool to report changes applied when the Control Panel is accessed, since actual keystrokes and mouse movement/clicks are not saved.

Specified by:
getDiffString in class Options
Parameters:
options - The Options to be compared against this instance.
Returns:
A String detailing the difference between the two instances.