Class SwingIntermediateResultListener<E>

    • Constructor Detail

      • SwingIntermediateResultListener

        public SwingIntermediateResultListener​(java.util.function.Consumer<E> intermediateListener)
        Create a new listener with functional interfaces.
        Parameters:
        intermediateListener - The intermediate listener.
      • SwingIntermediateResultListener

        public SwingIntermediateResultListener​(java.util.function.Consumer<E> ilistener,
                                               java.util.function.Consumer<java.lang.Void> flistener)
        Create a new listener with functional interfaces.
        Parameters:
        ilistener - The intermediate listener.
        flistener - The finished listener, called when no more intermediate results will arrive.
      • SwingIntermediateResultListener

        public SwingIntermediateResultListener​(java.util.function.Consumer<E> ilistener,
                                               java.util.function.Consumer<java.lang.Void> flistener,
                                               java.util.function.Consumer<java.lang.Exception> elistener,
                                               java.util.function.Consumer<java.lang.Integer> clistener)
        Create a new listener with functional interfaces.
        Parameters:
        ilistener - The intermediate listener.
        flistener - The finished listener, called when no more intermediate results will arrive.
        elistener - The listener that is called on exceptions.
      • SwingIntermediateResultListener

        public SwingIntermediateResultListener​(IIntermediateResultListener<E> listener)
        Create a new listener.
    • Method Detail

      • resultAvailable

        public void resultAvailable​(java.util.Collection<E> result)
        Called when the result is available. This method is only called for non-intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method has not been called.
        Specified by:
        resultAvailable in interface IResultListener<E>
        Parameters:
        result - The final result.
      • exceptionOccurred

        public void exceptionOccurred​(java.lang.Exception exception)
        Called when an exception occurred.
        Specified by:
        exceptionOccurred in interface IResultListener<E>
        Parameters:
        exception - The exception.
      • finished

        public void finished()
        Declare that the future is finished. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method was called for all intermediate results before.
        Specified by:
        finished in interface IIntermediateResultListener<E>
      • maxResultCountAvailable

        public void maxResultCountAvailable​(int max)
        Description copied from interface: IIntermediateResultListener
        Declare that the future result count is available. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method will be called as often as the result count indicates except an exception occurs.
        Specified by:
        maxResultCountAvailable in interface IIntermediateResultListener<E>
      • customFinished

        public void customFinished()
        Declare that the future is finished.
      • customResultAvailable

        public void customResultAvailable​(java.util.Collection<E> result)
        Called when the result is available.
        Parameters:
        result - The result.
      • customExceptionOccurred

        public void customExceptionOccurred​(java.lang.Exception exception)
        Called when an exception occurred.
        Parameters:
        exception - The exception.
      • customIntermediateResultAvailable

        public void customIntermediateResultAvailable​(E result)
        Called when an intermediate result is available.
        Parameters:
        result - The result.
      • customCommandAvailable

        public void customCommandAvailable​(java.lang.Object command)
        Called when a command is available.
      • resultAvailableIfUndone

        public void resultAvailableIfUndone​(java.util.Collection<E> result)
        Called when the result is available.
        Specified by:
        resultAvailableIfUndone in interface IUndoneResultListener<E>
        Parameters:
        result - The result.
      • exceptionOccurredIfUndone

        public void exceptionOccurredIfUndone​(java.lang.Exception exception)
        Called when an exception occurred.
        Specified by:
        exceptionOccurredIfUndone in interface IUndoneResultListener<E>
        Parameters:
        exception - The exception.
      • finishedIfUndone

        public void finishedIfUndone()
        Declare that the future is finished. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method was called for all intermediate results before.
        Specified by:
        finishedIfUndone in interface IUndoneIntermediateResultListener<E>
      • isUndone

        public boolean isUndone()
        Get the undone.
        Returns:
        The undone.