eu.semaine.system
Class CharacterConfigInfo

java.lang.Object
  extended by eu.semaine.system.CharacterConfigInfo

public class CharacterConfigInfo
extends java.lang.Object

This class is (intended to become) the single Java entry point for all configuration information needed to define the appearance and behaviour of the characters in the system. Everything a Java component needs to know about a Character should be defined here. The information is read from an XML config file; the filename must be given as property "semaine.character-config", in the java config file.

Author:
marc

Method Summary
static java.lang.Iterable<java.lang.String> getCharacterNames()
          Get all character names for which chracter config info is available.
static CharacterConfigInfo getDefaultCharacter()
           
 float getEmotionalPredisposition(java.lang.String vocabularyURI, java.lang.String dimension)
          For the given emotion dimension, provide any predisposition that the character may have.
 java.util.List<java.lang.String[]> getEmotionalPredispositions()
          Get a complete list of the emotional predispositions defined for this character.
static CharacterConfigInfo getInfo(java.lang.String characterName)
          The public entry point for getting access to character info by name.
 java.lang.String getName()
           
 java.lang.String getSetting(java.lang.String name)
          Generic mechanism for providing String-valued key-value pairs from the config file, using <setting name="..." value="..."
 java.util.Set<java.lang.String> getSettings()
          Provide the list of all setting names which are defined for this character.
 java.lang.String getVoiceEffects()
           
 java.util.Locale getVoiceLocale()
           
 java.lang.String getVoiceLocaleString()
           
 java.lang.String[] getVoices()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInfo

public static CharacterConfigInfo getInfo(java.lang.String characterName)
The public entry point for getting access to character info by name.

Parameters:
characterName - the character's name.
Returns:
a CharacterConfigInfo object describing the Character's properties, or null if there is no character with that name.

getCharacterNames

public static java.lang.Iterable<java.lang.String> getCharacterNames()
Get all character names for which chracter config info is available.

Returns:

getDefaultCharacter

public static CharacterConfigInfo getDefaultCharacter()

getName

public java.lang.String getName()

getVoices

public java.lang.String[] getVoices()

getVoiceLocaleString

public java.lang.String getVoiceLocaleString()

getVoiceLocale

public java.util.Locale getVoiceLocale()

getVoiceEffects

public java.lang.String getVoiceEffects()

getEmotionalPredisposition

public float getEmotionalPredisposition(java.lang.String vocabularyURI,
                                        java.lang.String dimension)
For the given emotion dimension, provide any predisposition that the character may have.

Parameters:
vocabularyURI - the URI identifying the emotion dimension vocabulary being used
dimension - the name of an emotion dimension, which must be part of the given vocabulary
Returns:
a float value in the interval [0, 1] if the current character has such a predisposition, or -1 if there is no such predisposition (i.e. the value is undefined).

getEmotionalPredispositions

public java.util.List<java.lang.String[]> getEmotionalPredispositions()
Get a complete list of the emotional predispositions defined for this character.

Returns:
a list of two-item String arrays, or an empty list if there are no predispositions. For each array a, a[0] is the vocabularyURI, and a[1] is the name of the dimension. Together these can be used to get the actual value of the predisposition from getEmotionalPredisposition(String, String).

getSetting

public java.lang.String getSetting(java.lang.String name)
Generic mechanism for providing String-valued key-value pairs from the config file, using <setting name="..." value="..."/>.

Parameters:
name - the setting's name, which must match the name attribute in the config file.
Returns:
the corresponding String value, or null if there is no such setting.

getSettings

public java.util.Set<java.lang.String> getSettings()
Provide the list of all setting names which are defined for this character. The corresponding values can then be obtained using getSetting(String).

Returns:
a set of Strings, or the empty set if there are no settings for this character.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object