LoginSystem/src/tools/utils/ToolTask.java
ljacqu 1e2a0f98ba Tools: pass Scanner to tasks and revert options management
- Remove TaskOption and central logic for processing options. It is not flexible and clear enough without investing a lot of effort. Fix is easy - just pass the scanner and let the task do what it needs to do.
2015-12-12 10:37:08 +01:00

26 lines
521 B
Java

package utils;
import java.util.Scanner;
/**
* Common interface for tool tasks. Note that the implementing tasks are instantiated
* with the default constructor. It is required that it be public.
*/
public interface ToolTask {
/**
* Return the name of the task.
*
* @return Name of the task
*/
String getTaskName();
/**
* Execute the task.
*
* @param scanner Scanner to prompt the user with for options. Do not close it.
*/
void execute(Scanner scanner);
}