|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.profiling.Options standup.lexicon.OptionsLexicon
public class OptionsLexicon
A subclass of Options
that stores user-specific settings for a
ProfileLexicon
. It contains filenames of the custom lexicons,
blacklists, and topics. The filenames are assumed relative to the path
returned by ProfileManager.getLexiconDirectory(String)
.
Note that the custom lexicons, topics and blacklists are not instantiated --
they are assumed to exist in the referenced files. If the files do not exist,
or are ill-formed, it will probably be found out when
LexicalComponents.setProfile(standup.profiling.Profile, boolean)
is
called.
Field Summary | |
---|---|
private Set<String> |
blacklistFilenames
|
private Set<String> |
customLexiconFilenames
|
private static String |
TAG_BLACKLISTS
|
private static String |
TAG_CUSTOMLEXICONS
|
static String |
TAG_ROOT
|
private static String |
TAG_TOPICS
|
private Set<String> |
topicFilenames
|
Constructor Summary | |
---|---|
OptionsLexicon()
Constructor that uses the values in the default options package. |
|
OptionsLexicon(Element rootElement)
Constructor that uses the values specified by the given XML Element . |
|
OptionsLexicon(Set<String> customLexiconFilenames,
Set<String> blacklistFilenames,
Set<String> topicFilenames)
Constructor that provides all filenames of the custom lexicons, blacklists, and topics. |
Method Summary | |
---|---|
boolean |
addBlacklistFilename(String filename)
Adds the given filename to the list of blacklist filenames stored within this OptionsLexicon . |
boolean |
addCustomLexiconFilename(String filename)
Adds the given filename to the list of custom lexicon filenames stored within this OptionsLexicon . |
boolean |
addTopicFilename(String filename)
Adds the given filename to the list of topic filenames stored within this OptionsLexicon . |
Set<String> |
getBlacklistFilenames()
Returns a List<String> containing the filenames of blacklists in
this OptionsLexicon . |
Set<String> |
getCustomLexiconFilenames()
Returns a List<String> containing the filenames of custom
lexicons in this OptionsLexicon . |
String |
getDiffString(Options options)
Returns a String that reports the difference between this
instance and the given Options . |
OptionsGUI |
getGUI(Dimension size)
For now, simply returns null -- we haven't properly implemented
OptionsGUILexicon yet. |
Set<String> |
getTopicFilenames()
Returns a List<String> containing the filenames of topics in this
OptionsLexicon . |
String |
getXMLTag()
Returns the XML tag associated with this implementation of Options . |
private static Set<String> |
parseFilenames(Element filenamesElement)
|
boolean |
removeBlacklistFilename(String filename)
Removes the given filename from the list of blacklist filenames stored within this OptionsLexicon . |
boolean |
removeCustomLexiconFilename(String filename)
Removes the given filename from the list of custom lexicon filenames stored within this OptionsLexicon . |
boolean |
removeTopicFilename(String filename)
Removes the given filename from the list of topic filenames stored within this OptionsLexicon . |
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 |
---|
public static final String TAG_ROOT
private static final String TAG_CUSTOMLEXICONS
private static final String TAG_BLACKLISTS
private static final String TAG_TOPICS
private Set<String> customLexiconFilenames
private Set<String> blacklistFilenames
private Set<String> topicFilenames
Constructor Detail |
---|
public OptionsLexicon(Set<String> customLexiconFilenames, Set<String> blacklistFilenames, Set<String> topicFilenames)
ProfileManager#getLexiconDirectory()
.
customLexiconFilenames
- blacklistFilenames
- topicFilenames
- public OptionsLexicon(Element rootElement)
Element
.
rootElement
- public OptionsLexicon() throws ProfileException
ProfileException
ProfileManager.getDefaultOptionsPackage()
Method Detail |
---|
public OptionsGUI getGUI(Dimension size)
null
-- we haven't properly implemented
OptionsGUILexicon yet.
getGUI
in class Options
public Set<String> getCustomLexiconFilenames()
List<String>
containing the filenames of custom
lexicons in this OptionsLexicon
.
public Set<String> getBlacklistFilenames()
List<String>
containing the filenames of blacklists in
this OptionsLexicon
.
public Set<String> getTopicFilenames()
List<String>
containing the filenames of topics in this
OptionsLexicon
.
public boolean addCustomLexiconFilename(String filename)
OptionsLexicon
. The filename is assumed to be
relative to the directory returned by
ProfileManager.getLexiconDirectory(String)
for the current user.
The custom lexicon itself is not handled at all.
filename
-
true
if the filename did not previously exist in the list of
custom lexicon filenames, false
otherwisepublic boolean addBlacklistFilename(String filename)
OptionsLexicon
. The filename is assumed to be relative to
the directory returned by
ProfileManager.getLexiconDirectory(String)
for the current user.
The blacklist itself is not handled at all.
filename
-
true
if the filename did not previously exist in the list of
blacklist filenames, false
otherwisepublic boolean addTopicFilename(String filename)
OptionsLexicon
. The filename is assumed to be relative to the
directory returned by ProfileManager.getLexiconDirectory(String)
for the current user. The topic itself is not handled at all.
filename
-
true
if the filename did not previously exist in the list of
topic filenames, false
otherwisepublic boolean removeCustomLexiconFilename(String filename)
OptionsLexicon
. The filename is assumed to be
relative to the directory returned by
ProfileManager.getLexiconDirectory(String)
for the current user.
The custom lexicon itself is not handled at all.
filename
-
true
if the filename previously existed in the list of
custom lexicon filenames, false
otherwisepublic boolean removeBlacklistFilename(String filename)
OptionsLexicon
. The filename is assumed to be
relative to the directory returned by
ProfileManager.getLexiconDirectory(String)
for the current user.
The blacklist itself is not handled at all.
filename
-
true
if the filename previously existed in the list of
blacklist filenames, false
otherwisepublic boolean removeTopicFilename(String filename)
OptionsLexicon
. The filename is assumed to be
relative to the directory returned by
ProfileManager.getLexiconDirectory(String)
for the current user.
The topic itself is not handled at all.
filename
-
true
if the filename previously existed in the list of
topic filenames, false
otherwiseprivate static Set<String> parseFilenames(Element filenamesElement)
public String getXMLTag()
Options
Options
.
getXMLTag
in class Options
public void writeXML(Writer out, String indent) throws IOException, XMLException
XMLizable
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.
IOException
XMLException
public String getDiffString(Options options)
String
that reports the difference between this
instance and the given Options
. Currently used by the Playback
tool.
getDiffString
in class Options
options
- The Options
to be compared against this instance.
String
detailing the difference between the two
instances.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |