|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstandup.profiling.Profile
public abstract class Profile
A subclass of Profile
stores user-specific information for a
corresponding Profileable
implementation.
It contains values for various option settings chosen by the user, stored in
an Options
class, and other user-specific data such as usage records,
history, etc.
Note that Profile
implements XMLsaveable
-- this is because a
Profile
can be loaded/saved to disk as an XML file.
Field Summary | |
---|---|
private Options |
options
|
Constructor Summary | |
---|---|
Profile()
Constructor that creates a default profile (using appropriate default options). |
|
Profile(Element element)
Constructor given an XML Element that contains an appropriate profile definition. |
|
Profile(File profileFile)
Constructor given an XML File that contains an appropriate profile definition. |
|
Profile(Options options)
Constructor where the Options are directly provided as an
argument. |
|
Profile(URL profileURL)
Constructor given a URL that refers to an XML file that contains an appropriate profile definition. |
Method Summary | |
---|---|
abstract Options |
createDefaultOptions()
Returns an appropriate instance of Options with default values,
i.e. |
Options |
getOptions()
Returns the Options contained within this Profile . |
abstract Options |
loadOptions(Element element)
Returns an appropriate instance of Options whose values are taken
from the given XML Element. |
abstract void |
quickSave(File file)
Saves this Profile but not any associated files along with it. |
boolean |
setOptions(Options options)
Makes the given Options the one used within this Profile . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface standup.xml.XMLsaveable |
---|
save |
Methods inherited from interface standup.xml.XMLizable |
---|
writeXML |
Field Detail |
---|
private Options options
Constructor Detail |
---|
public Profile(Options options)
Options
are directly provided as an
argument.
options
- public Profile(URL profileURL)
profileURL
- public Profile(File profileFile)
profileFile
- public Profile() throws ProfileException
ProfileException
public Profile(Element element)
element
- Method Detail |
---|
public Options getOptions()
Options
contained within this Profile
. It
might be useful to override this method to return the options cast as the
appropriate specific Options
subclass.
public boolean setOptions(Options options)
Options
the one used within this Profile
.
Always returns true
. Override this method to do validation that
the given Options
is indeed appropriate for the particular
subclass of Profile
.
options
-
public abstract Options createDefaultOptions() throws ProfileException
Options
with default values,
i.e. those contained with the default options package (see
ProfileManager.getDefaultOptionsPackage()
).
ProfileException
public abstract Options loadOptions(Element element)
Options
whose values are taken
from the given XML Element.
public abstract void quickSave(File file) throws XMLException
Profile
but not any associated files along with it.
This is for profiles which may depend on other files aside from the XML
file created by ProfileManager
. For example, the joke generation
backend ProfileJokeGeneration
contains pointers to XML files that
contain the custom lexicon, topic database, etc. If a Profile
doesn't have any such files, this method behaves the same as
XMLsaveable.save(File)
.
file
- the file to which this Profile
should be saved.
XMLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |