Package org.svvrl.goal.cmd
Class CommandRepository
java.lang.Object
org.svvrl.goal.cmd.CommandRepository
public class CommandRepository
extends java.lang.Object
CommandRepository
provides methods for accessing the command pool.
Note that all the names of commands stored in this repository are converted
to lower cases.- Author:
- Ming-Hsien Tsai
-
Constructor Summary
Constructors Constructor Description CommandRepository()
-
Method Summary
Modifier and Type Method Description static void
addCommandExtension(CommandExtension ext)
Inserts a command extension to this repository.static void
addComplementConstruction(ComplementConstructionExtension ext)
Inserts a complementation construction extension to this repository.static void
addComplementConstruction(ComplementConstructionExtension ext, AutomatonType type)
Inserts a complementation construction extension to this repository and sets the provided construction the default complementation construction for a specified automaton type.static void
addComplementConstructionInterface(ComplementConstructionInterface intf)
Deprecated.static void
addComplementConstructionInterface(ComplementConstructionInterface intf, AutomatonType type)
Deprecated.static void
addGameSolver(java.lang.String name, GameSolverExtension solver)
Deprecated.useaddGameSolver(GameSolverExtension)
instead since the name of a solver is provided by itselfstatic void
addGameSolver(GameSolverExtension solver)
Inserts a game solver extension to this repository.static void
addGenerator(GeneratorExtension ext)
Adds a generator extension.static java.util.Collection<java.lang.String>
getClosestCommands(java.lang.String name)
Returns the command names in the repository that are closest to a specified incorrect command name.static CommandExpression
getCommand(java.lang.String name, java.util.List<Expression> args)
Returns the command expression with a specified command name and command arguments.static CommandExtension
getCommandExtension(java.lang.String name)
Returns the command extension with a specified command namestatic java.lang.String[]
getCommandNames()
Returns all available command names.static ComplementConstructionExtension
getComplementConstruction(java.lang.String name)
Returns the complementation construction extension with a specified name.static java.lang.String[]
getComplementConstructionNames()
Returns all available names of complementation construction extensions.static ComplementConstructionExtension
getDefaultComplementConstruction(AutomatonType type)
Returns the default complementation construction extension for a type of automaton.static java.util.Map<AutomatonType,ComplementConstructionExtension>
getDefaultComplementConstructions()
Returns a copy of the map from an automaton type to its default complementation construction extension.static GameSolverExtension
getGameSolver(java.lang.String name)
Returns the game solver extension with a specified name.static java.lang.String[]
getGameSolverNames()
Returns the names of available game solver extensions.static GeneratorExtension
getGenerator(java.lang.String name)
Returns the generator extension with a specified name.static java.util.Set<java.lang.String>
getGeneratorNames()
Returns all the names of the generator extensions in this repository.static java.util.Collection<GeneratorExtension>
getGenerators()
Returns all generator extensions in this repository.static boolean
hasCommand(java.lang.String name)
Returnstrue
if this repository has the command of a specified name.
-
Constructor Details
-
CommandRepository
public CommandRepository()
-
-
Method Details
-
addCommandExtension
Inserts a command extension to this repository.- Parameters:
ext
- a command extension to be inserted
-
getCommandExtension
Returns the command extension with a specified command name- Parameters:
name
- a command name- Returns:
- the command extension with command name
name
-
hasCommand
public static boolean hasCommand(java.lang.String name)Returnstrue
if this repository has the command of a specified name.- Parameters:
name
- a name- Returns:
true
if this repository has the command of the specified name
-
getCommandNames
public static java.lang.String[] getCommandNames()Returns all available command names.- Returns:
- all available command names
-
getCommand
public static CommandExpression getCommand(java.lang.String name, java.util.List<Expression> args) throws EvaluationExceptionReturns the command expression with a specified command name and command arguments.- Parameters:
name
- the name of the commandargs
- the arguments of the command- Returns:
- the command expression constructed from the command name
name
and the command argumentsargs
, ornull
if there is no such command - Throws:
EvaluationException
- if there is a problem in instantiating the command, or the argumentsargs
are not accepted by the command
-
addComplementConstruction
Inserts a complementation construction extension to this repository.- Parameters:
ext
- the complementation construction extension to be inserted
-
addComplementConstruction
public static void addComplementConstruction(ComplementConstructionExtension ext, AutomatonType type)Inserts a complementation construction extension to this repository and sets the provided construction the default complementation construction for a specified automaton type.- Parameters:
ext
- the complementation construction extension to be insertedtype
- an automaton type
-
getComplementConstructionNames
public static java.lang.String[] getComplementConstructionNames()Returns all available names of complementation construction extensions.- Returns:
- all available names of complementation construction extensions
-
getComplementConstruction
Returns the complementation construction extension with a specified name.- Parameters:
name
- the name of the complementation construction- Returns:
- the extension of the complementation construction
-
getDefaultComplementConstruction
Returns the default complementation construction extension for a type of automaton.- Parameters:
type
- an automaton type- Returns:
- the default complementation construction extension for the type of automaton
-
getDefaultComplementConstructions
public static java.util.Map<AutomatonType,ComplementConstructionExtension> getDefaultComplementConstructions()Returns a copy of the map from an automaton type to its default complementation construction extension.- Returns:
- a map from an automaton type to its default complementation construction extension
-
addGameSolver
Deprecated.useaddGameSolver(GameSolverExtension)
instead since the name of a solver is provided by itselfInserts a game solver extension to this repository.- Parameters:
name
- the name of the game solversolver
- the game solver extension to be inserted
-
addGameSolver
Inserts a game solver extension to this repository.- Parameters:
solver
- the game solver extension to be inserted
-
getGameSolver
Returns the game solver extension with a specified name.- Parameters:
name
- the name of the returned solver- Returns:
- the game solver extension with the specified name, or
null
if there is no solver of such name
-
getGameSolverNames
public static java.lang.String[] getGameSolverNames()Returns the names of available game solver extensions.- Returns:
- the names of available game solver extensions
-
addGenerator
Adds a generator extension.- Parameters:
ext
- the generator extension
-
getGenerator
Returns the generator extension with a specified name.- Parameters:
name
- a name- Returns:
- the generator extension with the name, or null if there is no such generator extension
-
getGeneratorNames
public static final java.util.Set<java.lang.String> getGeneratorNames()Returns all the names of the generator extensions in this repository.- Returns:
- all the names of the generator extensions in this repository
-
getGenerators
Returns all generator extensions in this repository.- Returns:
- all generator extensions in this repository
-
getClosestCommands
public static java.util.Collection<java.lang.String> getClosestCommands(java.lang.String name)Returns the command names in the repository that are closest to a specified incorrect command name.- Parameters:
name
- a command name that is supposed to be incorrect- Returns:
- the command names that are closest to the incorrect command name
-
addComplementConstructionInterface
@Deprecated public static void addComplementConstructionInterface(ComplementConstructionInterface intf)Deprecated.Inserts a complementation construction interface to this repository.- Parameters:
intf
- the complementation construction interface to be inserted
-
addComplementConstructionInterface
@Deprecated public static void addComplementConstructionInterface(ComplementConstructionInterface intf, AutomatonType type)Deprecated.Inserts a complementation construction interface to this repository and sets the provided construction the default complementation construction for a specified automaton type.- Parameters:
intf
- the complementation construction interface to be insertedtype
- an automaton type
-