Interface Catalog<C extends Context>

Type Parameters:
C - Type of the context associated with this command
All Known Implementing Classes:
CatalogBase

public interface Catalog<C extends Context>
A Catalog is a collection of named Commands (or Chains) that can be used to retrieve the set of commands that should be performed based on a symbolic identifier. Use of catalogs is optional, but convenient when there are multiple possible chains that can be selected and executed based on environmental conditions.
Version:
$Revision$ $Date$
Author:
Craig R. McClanahan
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A default context attribute for storing a default Catalog, provided as a convenience only.
  • Method Summary

    Modifier and Type
    Method
    Description
    <CMD extends Command<C>>
    void
    addCommand(String name, CMD command)
    Add a new name and associated Command or Chain to the set of named commands known to this Catalog, replacing any previous command for that name.
    <CMD extends Command<C>>
    CMD
    Return the Command or Chain associated with the specified name, if any; otherwise, return null.
    Return an Iterator over the set of named commands known to this Catalog.
  • Field Details

  • Method Details

    • addCommand

      <CMD extends Command<C>> void addCommand(String name, CMD command)
      Add a new name and associated Command or Chain to the set of named commands known to this Catalog, replacing any previous command for that name.
      Type Parameters:
      CMD - the Command type to be added in the Catalog
      Parameters:
      name - Name of the new command
      command - Command or Chain to be returned for later lookups on this name
    • getCommand

      <CMD extends Command<C>> CMD getCommand(String name)
      Return the Command or Chain associated with the specified name, if any; otherwise, return null.
      Type Parameters:
      CMD - the expected Command type to be returned
      Parameters:
      name - Name for which a Command or Chain should be retrieved
      Returns:
      The Command associated with the specified name.
    • getNames

      Return an Iterator over the set of named commands known to this Catalog. If there are no known commands, an empty Iterator is returned.
      Returns:
      An iterator of the names in this Catalog.