Class Opt4JTask

    • Field Detail

      • injector

        protected com.google.inject.Injector injector
      • parentInjector

        protected com.google.inject.Injector parentInjector
      • closeOnStop

        protected final boolean closeOnStop
      • isClosed

        protected boolean isClosed
    • Constructor Detail

      • Opt4JTask

        @Inject
        public Opt4JTask()
        Constructs a Opt4JTask.
      • Opt4JTask

        public Opt4JTask​(boolean closeOnStop)
        Constructs a Opt4JTask.
        Parameters:
        closeOnStop - close automatically after optimization
    • Method Detail

      • init

        public void init​(com.google.inject.Injector injector)
        Initialize with a parent Injector.
        Parameters:
        injector - the parent injector
      • close

        public void close()
        Close the task.
      • open

        public void open()
        Initialize a task manually before executing it. This enables to get instances of classes before the optimization starts.
      • getIteration

        public int getIteration()
        Returns the current iteration.
        Returns:
        the current iteration
      • getInstance

        public <O> O getInstance​(Class<O> type)
        Returns the instance of the given class.
        Type Parameters:
        O - the type of class
        Parameters:
        type - the class
        Returns:
        the instance of the class
      • getInjector

        protected com.google.inject.Injector getInjector()
        Returns the Injector of the task.
        Returns:
        the injector
      • getOptimizer

        protected Optimizer getOptimizer()
        Returns the Optimizer of the task.
        Returns:
        the optimizer