source: trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Command.java @ 664

Last change on this file since 664 was 664, checked in by sherbold, 12 years ago
  • modified Command.help(): the help now returns a string with its usage instead of writing directly to the console
  • modified listCommands: now writes the help string of each command instead of just the name; this way, the parameters are displayed directly
  • moved listCommands from quest-ui-core to java-utils
File size: 693 bytes
Line 
1package de.ugoe.cs.util.console;
2
3import java.util.List;
4
5/**
6 * <p>
7 * Defines the interface for a command. The class names of the commands must be
8 * of the form {@code CMD<commandname>}, otherwise they cannot be used by the
9 * {@link CommandExecuter}.
10 * </p>
11 *
12 * @author Steffen Herbold
13 * @version 1.0
14 */
15public interface Command {
16
17        /**
18         * <p>
19         * Executes a command.
20         * </p>
21         *
22         * @param parameters
23         *            parameters for the command.
24         */
25        public void run(List<Object> parameters);
26
27        /**
28         * <p>
29         * Returns a string the contains information about how to use the command.
30         * </p>
31         * @return help string
32         */
33        public String help();
34}
Note: See TracBrowser for help on using the repository browser.