public class ACIS
extends java.lang.Object
Language
.Action
s, the Environment
s for them and the
context system.ContextStack
size is 30;Modifier and Type | Class and Description |
---|---|
static class |
ACIS.OnExecutionListener
Represents a listener for events in the
executeNewThread(String, float, WeightSet, OnExecutionListener)
function. |
Modifier and Type | Field and Description |
---|---|
static int |
LIBRARY_VERSION
The library's version.
|
Constructor and Description |
---|
ACIS(Language language,
SystemEnvironment environment)
Constructor for a ACIS system.
|
ACIS(Language language,
SystemEnvironment environment,
java.io.File dataDirectory)
Constructor for a ACIS system.
|
Modifier and Type | Method and Description |
---|---|
ActionResult |
execute(java.lang.String input,
float threshold,
WeightSet weightSet,
ACIS.OnExecutionListener executionListener)
Matches the input and executes the best
Action (if not overwritten in
ACIS.OnExecutionListener ). |
java.lang.Thread |
executeNewThread(java.lang.String input,
float threshold,
WeightSet weightSet,
ACIS.OnExecutionListener executionListener)
Matches the input and executes the best
Action (if not overwritten in
ACIS.OnExecutionListener ). |
ActionManager |
getActionManager()
Returns the
ActionManager of the system in which all Action s
are registered. |
java.io.File |
getDataDirectory()
Returns the data directory the system uses.
|
Environment |
getEnvironment(ActionPackage pack)
Returns the
Environment for a specific ActionPackage using
the SystemEnvironment which was previously set in the constructor. |
Environment |
getEnvironment(ActionPackage pack,
SystemEnvironment systemEnvironment)
Returns the
Environment for a specific ActionPackage using an
other SystemEnvironment than the one of this ACIS system.. |
ContextStack |
getGeneralContext()
Returns the
ContextStack including all context items (even
ContextVisibility.PRIVATE ). |
Language |
getLanguage()
Returns the
Language used by the system. |
Logging.Logger |
getLogger()
Returns the system
Logging.Logger . |
float |
getMatcherParameterThreshold()
A function which returns the parameter matching threshold.
|
java.io.File |
getPackageFilesDirectory()
Returns the directory in which the packages containing actions are saved.
|
SystemEnvironment |
getSystemEnvironment()
Returns the
SystemEnvironment used by the system. |
Preferences |
getSystemPreferences()
Returns the systems
Preferences . |
WordCache |
getWordCache()
|
void |
setDataDirectory(java.io.File dataDirectory)
Sets the data directory in which the system writes its data.
|
void |
setGeneralContextMaximumSize(int maxSize)
Sets the size of the
ContextStack . |
void |
setMatcherParameterThreshold(float matcherParameterThreshold)
Sets the parameter matching threshold.
|
public static final int LIBRARY_VERSION
public ACIS(Language language, SystemEnvironment environment) throws java.io.IOException
language
- The Language
to use.environment
- The SystemEnvironment
to use.java.io.IOException
- When there is no way to save files.public ACIS(Language language, SystemEnvironment environment, java.io.File dataDirectory) throws java.io.IOException
language
- The Language
to use.environment
- The SystemEnvironment
to use.dataDirectory
- The directory to save the systems data in.java.io.IOException
- When the dataDirectory
is no directory.public java.io.File getDataDirectory()
public java.io.File getPackageFilesDirectory()
public void setDataDirectory(java.io.File dataDirectory) throws java.io.IOException
dataDirectory
- The directory.java.io.IOException
- When the dataDirectory
is no directory.public Language getLanguage()
Language
used by the system.public SystemEnvironment getSystemEnvironment()
SystemEnvironment
used by the system.public Environment getEnvironment(ActionPackage pack)
Environment
for a specific ActionPackage
using
the SystemEnvironment
which was previously set in the constructor.pack
- The ActionPackage
.Environment
specifically for this ActionPackage
.public Environment getEnvironment(ActionPackage pack, SystemEnvironment systemEnvironment)
Environment
for a specific ActionPackage
using an
other SystemEnvironment
than the one of this ACIS system..pack
- The ActionPackage
.systemEnvironment
- The SystemEnvironment
.Environment
specifically for this ActionPackage
.public Logging.Logger getLogger()
Logging.Logger
.Logging.Logger
Object.public Preferences getSystemPreferences()
Preferences
.Preferences
Object.public ActionManager getActionManager()
ActionManager
of the system in which all Action
s
are registered.ActionManager
.public float getMatcherParameterThreshold()
public void setMatcherParameterThreshold(float matcherParameterThreshold)
matcherParameterThreshold
- The parameter threshold. Value must be between 0 and 1.public ContextStack getGeneralContext()
ContextStack
including all context items (even
ContextVisibility.PRIVATE
).ContextStack
.public void setGeneralContextMaximumSize(int maxSize)
ContextStack
.maxSize
- The size to set.public ActionResult execute(java.lang.String input, float threshold, WeightSet weightSet, ACIS.OnExecutionListener executionListener) throws java.lang.IllegalThreadStateException
Action
(if not overwritten in
ACIS.OnExecutionListener
).ACIS
Object was created with.input
- The user input.threshold
- The threshold for which Action
s with a lower match score
are ignored.weightSet
- The WeightSet
to use for matching.executionListener
- The listener for the execution events. May be null
.null
when there
were no results or no ActionResult given by the methods of the
executionListener
.java.lang.IllegalThreadStateException
- When executed on the same Thread the ACIS Object was created in.public java.lang.Thread executeNewThread(java.lang.String input, float threshold, WeightSet weightSet, ACIS.OnExecutionListener executionListener)
Action
(if not overwritten in
ACIS.OnExecutionListener
).Thread
is started.