Class Task

  • All Implemented Interfaces:
    java.util.concurrent.Callable<java.lang.Void>
    Direct Known Subclasses:
    Opt4JTask

    public abstract class Task
    extends java.lang.Object
    implements java.util.concurrent.Callable<java.lang.Void>
    The Task is an abstract class for optimization tasks.
    See Also:
    ExecutionEnvironment
    • Field Detail

      • e

        protected java.lang.Exception e
      • modules

        protected final java.util.List<com.google.inject.Module> modules
      • isInit

        protected boolean isInit
    • Constructor Detail

      • Task

        public Task()
    • Method Detail

      • init

        public void init​(com.google.inject.Module... modules)
        Initializes the Task with modules.
        Parameters:
        modules - the modules for the task
        See Also:
        init(Collection)
      • init

        public void init​(java.util.Collection<com.google.inject.Module> modules)
        Initializes the Task with modules. Note that if a module is a PropertyModule, a copy is made with the PropertyModule.clone() method. If the Module is not a PropertyModule, the module is copied as a reference, i.e., it can be changed until the execute() is called.
        Parameters:
        modules - the modules for the task
      • execute

        public abstract void execute()
                              throws java.lang.Exception
        Executes the Task.
        Throws:
        java.lang.Exception
      • call

        public java.lang.Void call()
                            throws java.lang.Exception
        Specified by:
        call in interface java.util.concurrent.Callable<java.lang.Void>
        Throws:
        java.lang.Exception
      • getException

        public java.lang.Exception getException()
        Returns the Exception that was thrown during the Task execution if an error occurred.
        Returns:
        the occurred exception
      • getState

        public Task.State getState()
        Returns the state of the Task.
        Returns:
        the state of the task
      • setState

        protected void setState​(Task.State state)
        Sets the state of the Task.
        Parameters:
        state - the state of the task to be set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getModules

        public java.util.Collection<com.google.inject.Module> getModules()
        Returns a copy of the Modules of this Task.
        Returns:
        a set of modules