org.omnaest.utils.structure.collection.list.decorator
Class ListDispatcher.ListDispatchControl<E>

java.lang.Object
  extended by org.omnaest.utils.structure.collection.list.decorator.ListDispatcher.ListDispatchControl<E>
Type Parameters:
E -
Enclosing class:
ListDispatcher<E>

protected static class ListDispatcher.ListDispatchControl<E>
extends Object

The ListDispatcher.ListDispatchControl allows to control to which List the method invocations to the ListDispatcher will be forwarded to.

Author:
Omnaest

Constructor Summary
ListDispatcher.ListDispatchControl(List<E>... lists)
           
 
Method Summary
 int getCurrentListIndex()
           
<L extends List<E>>
L
getList()
          Returns the currently active List to which all method invocations should be forwarded.
 ListDispatcher.ListDispatchControl<E> rolloverToNextList()
          Moves all elements of the current active dispatch List to the next and switches to this List.
 ListDispatcher.ListDispatchControl<E> rolloverToPreviousList()
          Moves all elements of the current active dispatch List to the previous and switches to this List.
 ListDispatcher.ListDispatchControl<E> switchToNextInternalList()
          Switches to the next internally available List
 ListDispatcher.ListDispatchControl<E> switchToPreviousInternalList()
          Switches to the next internally available List
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListDispatcher.ListDispatchControl

public ListDispatcher.ListDispatchControl(List<E>... lists)
Parameters:
lists -
See Also:
ListDispatcher.ListDispatchControl
Method Detail

switchToNextInternalList

public ListDispatcher.ListDispatchControl<E> switchToNextInternalList()
Switches to the next internally available List

Returns:
this

switchToPreviousInternalList

public ListDispatcher.ListDispatchControl<E> switchToPreviousInternalList()
Switches to the next internally available List

Returns:
this

rolloverToNextList

public ListDispatcher.ListDispatchControl<E> rolloverToNextList()
Moves all elements of the current active dispatch List to the next and switches to this List.

Returns:
this

rolloverToPreviousList

public ListDispatcher.ListDispatchControl<E> rolloverToPreviousList()
Moves all elements of the current active dispatch List to the previous and switches to this List.

Returns:
this

getList

public <L extends List<E>> L getList()
Returns the currently active List to which all method invocations should be forwarded.

Returns:

getCurrentListIndex

public int getCurrentListIndex()
Returns:
the currentListIndex

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.