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 Details

  • Method Details

    • addCommandExtension

      public static void addCommandExtension​(CommandExtension ext)
      Inserts a command extension to this repository.
      Parameters:
      ext - a command extension to be inserted
    • getCommandExtension

      public static CommandExtension getCommandExtension​(java.lang.String name)
      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)
      Returns true 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 EvaluationException
      Returns the command expression with a specified command name and command arguments.
      Parameters:
      name - the name of the command
      args - the arguments of the command
      Returns:
      the command expression constructed from the command name name and the command arguments args, or null if there is no such command
      Throws:
      EvaluationException - if there is a problem in instantiating the command, or the arguments args are not accepted by the command
    • addComplementConstruction

      public static void addComplementConstruction​(ComplementConstructionExtension ext)
      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 inserted
      type - 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

      public static ComplementConstructionExtension getComplementConstruction​(java.lang.String name)
      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

      public static ComplementConstructionExtension getDefaultComplementConstruction​(AutomatonType type)
      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 public static void addGameSolver​(java.lang.String name, GameSolverExtension solver)
      Deprecated.
      use addGameSolver(GameSolverExtension) instead since the name of a solver is provided by itself
      Inserts a game solver extension to this repository.
      Parameters:
      name - the name of the game solver
      solver - the game solver extension to be inserted
    • addGameSolver

      public static void addGameSolver​(GameSolverExtension solver)
      Inserts a game solver extension to this repository.
      Parameters:
      solver - the game solver extension to be inserted
    • getGameSolver

      public static GameSolverExtension getGameSolver​(java.lang.String name)
      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

      public static final void addGenerator​(GeneratorExtension ext)
      Adds a generator extension.
      Parameters:
      ext - the generator extension
    • getGenerator

      public static final GeneratorExtension getGenerator​(java.lang.String name)
      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

      public static final java.util.Collection<GeneratorExtension> 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 inserted
      type - an automaton type