Package jadex.commons.gui.future
Class SwingIntermediateResultListener<E>
- java.lang.Object
-
- jadex.commons.gui.future.SwingIntermediateResultListener<E>
-
- All Implemented Interfaces:
IFunctionalExceptionListener
,IFunctionalIntermediateFinishedListener<E>
,IFunctionalIntermediateResultCountListener
,IFunctionalIntermediateResultListener<E>
,IFunctionalResultListener<java.util.Collection<E>>
,IFutureCommandResultListener<java.util.Collection<E>>
,IIntermediateFutureCommandResultListener<E>
,IIntermediateResultListener<E>
,IResultListener<java.util.Collection<E>>
,IUndoneIntermediateResultListener<E>
,IUndoneResultListener<java.util.Collection<E>>
public class SwingIntermediateResultListener<E> extends java.lang.Object implements IIntermediateFutureCommandResultListener<E>, IUndoneIntermediateResultListener<E>
-
-
Field Summary
Fields Modifier and Type Field Description protected IIntermediateResultListener<E>
listener
The delegation listener.protected boolean
undone
The undone flag.
-
Constructor Summary
Constructors Constructor Description SwingIntermediateResultListener(IFunctionalResultListener<E> intermediateListener)
Create a new listener with functional interfaces.SwingIntermediateResultListener(IFunctionalResultListener<E> ilistener, IFunctionalResultListener<java.lang.Void> flistener)
Create a new listener with functional interfaces.SwingIntermediateResultListener(IFunctionalResultListener<E> ilistener, IFunctionalResultListener<java.lang.Void> flistener, IFunctionalExceptionListener elistener, IFunctionalIntermediateResultCountListener clistener)
Create a new listener with functional interfaces.SwingIntermediateResultListener(IIntermediateResultListener<E> listener)
Create a new listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commandAvailable(java.lang.Object command)
Called when a command is available.void
customCommandAvailable(java.lang.Object command)
Called when a command is available.void
customExceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.void
customFinished()
Declare that the future is finished.void
customIntermediateResultAvailable(E result)
Called when an intermediate result is available.void
customResultAvailable(java.util.Collection<E> result)
Called when the result is available.void
exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.void
exceptionOccurredIfUndone(java.lang.Exception exception)
Called when an exception occurred.void
finished()
Declare that the future is finished.void
finishedIfUndone()
Declare that the future is finished.void
intermediateResultAvailable(E result)
Called when an intermediate result is available.void
intermediateResultAvailableIfUndone(E result)
Called when an intermediate result is available.boolean
isUndone()
Get the undone.void
maxResultCountAvailable(int max)
Declare that the future result count is available.void
resultAvailable(java.util.Collection<E> result)
Called when the result is available.void
resultAvailableIfUndone(java.util.Collection<E> result)
Called when the result is available.
-
-
-
Field Detail
-
listener
protected IIntermediateResultListener<E> listener
The delegation listener.
-
undone
protected boolean undone
The undone flag.
-
-
Constructor Detail
-
SwingIntermediateResultListener
public SwingIntermediateResultListener(IFunctionalResultListener<E> intermediateListener)
Create a new listener with functional interfaces.- Parameters:
intermediateListener
- The intermediate listener.
-
SwingIntermediateResultListener
public SwingIntermediateResultListener(IFunctionalResultListener<E> ilistener, IFunctionalResultListener<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(IFunctionalResultListener<E> ilistener, IFunctionalResultListener<java.lang.Void> flistener, IFunctionalExceptionListener elistener, IFunctionalIntermediateResultCountListener 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 interfaceIFunctionalResultListener<E>
- Parameters:
result
- The final result.
-
exceptionOccurred
public void exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.- Specified by:
exceptionOccurred
in interfaceIFunctionalExceptionListener
- Parameters:
exception
- The exception.
-
intermediateResultAvailable
public void intermediateResultAvailable(E result)
Called when an intermediate result is available.- Specified by:
intermediateResultAvailable
in interfaceIFunctionalIntermediateResultListener<E>
- Specified by:
intermediateResultAvailable
in interfaceIIntermediateResultListener<E>
- Parameters:
result
- The result.
-
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 interfaceIFunctionalIntermediateFinishedListener<E>
- Specified by:
finished
in interfaceIIntermediateResultListener<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 interfaceIFunctionalIntermediateResultCountListener
- Specified by:
maxResultCountAvailable
in interfaceIIntermediateResultListener<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.
-
commandAvailable
public final void commandAvailable(java.lang.Object command)
Called when a command is available.- Specified by:
commandAvailable
in interfaceIFutureCommandResultListener<E>
-
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 interfaceIUndoneResultListener<E>
- Parameters:
result
- The result.
-
exceptionOccurredIfUndone
public void exceptionOccurredIfUndone(java.lang.Exception exception)
Called when an exception occurred.- Specified by:
exceptionOccurredIfUndone
in interfaceIUndoneResultListener<E>
- Parameters:
exception
- The exception.
-
intermediateResultAvailableIfUndone
public void intermediateResultAvailableIfUndone(E result)
Called when an intermediate result is available.- Specified by:
intermediateResultAvailableIfUndone
in interfaceIUndoneIntermediateResultListener<E>
- Parameters:
result
- The result.
-
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 interfaceIUndoneIntermediateResultListener<E>
-
isUndone
public boolean isUndone()
Get the undone.- Returns:
- The undone.
-
-