Class CommandLineApplication

  • All Implemented Interfaces:
    Serializable, Runnable

    public abstract class CommandLineApplication
    extends Application

    Abstract base class for a command line application. Child classes should implement the programLogic method and create a main method calling the Application.run(String[]) method. An example application is listed below.

     
        public class MyApplication extends CommandLineApplication {
    
          public static void main(String[] args)  {
            new MyApplication().run(args);
          }
    
          public void programLogic() throws Exception {
            //Logic goes here.
          }
    
        }
     
     
    Author:
    David B. Bracewell
    See Also:
    Serialized Form
    • Constructor Detail

      • CommandLineApplication

        protected CommandLineApplication()
        Instantiates a new Application.
      • CommandLineApplication

        protected CommandLineApplication​(String applicationName)
        Instantiates a new Application.
        Parameters:
        applicationName - the application name
    • Method Detail

      • programLogic

        protected abstract void programLogic()
                                      throws Exception
        Child classes override this method adding their program logic.
        Throws:
        Exception - Something abnormal happened.
      • run

        public final void run()