Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.puremvc.java.interfaces
Interface IController

All Known Implementing Classes:
  Controller

    public interface IController

The interface definition for a PureMVC Controller.

In PureMVC, an `IController` implementor follows the 'Command and Controller' strategy, and assumes these responsibilities:

- Remembering which `ICommand`s are intended to handle which `INotifications`.
- Registering itself as an `IObserver` with the `View` for each `INotification` that it has an `ICommand` mapping for.
- Creating a new instance of the proper `ICommand` to handle a given `INotification` when notified by the `View`.
- Calling the `ICommand`'s `execute` method, passing in the `INotification`.

See Also:
  `INotification`, `ICommand`

Method Summary
`void` | `executeCommand(INotification notification)` Execute the `ICommand` previously registered as the handler for `INotification`s with the given notification name.
`boolean` | `hasCommand(java.lang.String notificationName)` Check if a Command is registered for a given Notification
`void` | `registerCommand(java.lang.String notificationName, ICommand command)` Register a particular `ICommand` class as the handler for a particular `INotification`.
`void` | `removeCommand(java.lang.String notificationName)` Remove a previously registered `ICommand` to `INotification` mapping.

Method Detail

### registerCommand

    void registerCommand(java.lang.String notificationName,
                         ICommand command)

  Register a particular `ICommand` class as the handler for a particular `INotification`.

  Parameters:
    `notificationName` - the name of the `INotification`
    `command` - the Class of the `ICommand`

### executeCommand

    void executeCommand(INotification notification)

  Execute the `ICommand` previously registered as the handler for `INotification`s with the given notification name.

  Parameters:
    `notification` - the `INotification` to execute the associated `ICommand` for

### removeCommand

    void removeCommand(java.lang.String notificationName)

  Remove a previously registered `ICommand` to `INotification` mapping.

  Parameters:
    `notificationName` - the name of the `INotification` to remove the `ICommand` mapping for

### hasCommand

    boolean hasCommand(java.lang.String notificationName)

  Check if a Command is registered for a given Notification

  Parameters:
    `notificationName` -
  Returns:
    whether a Command is currently registered for the given `notificationName`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD