ch.tatool.core.element
Class IteratedListSelector

java.lang.Object
  extended by ch.tatool.core.element.AbstractListSelector
      extended by ch.tatool.core.element.IteratedListSelector
All Implemented Interfaces:
ElementSelector, Initializable
Direct Known Subclasses:
RandomOrderIteratedListSelector, TemporalListSelector

public class IteratedListSelector
extends AbstractListSelector

Iterates through the list of elements, executing each them in order. By default each element is executed once, but this behavior can be overridden restart the iteration as many times as requested.

Author:
Michael Ruflin

Constructor Summary
IteratedListSelector()
           
IteratedListSelector(int numberOfIterations)
           
 
Method Summary
protected  boolean canCreateIterator()
          Returns whether a new iterator can be created.
protected  boolean canExecuteNext()
          Can a next element be executed.
protected  Iterator<Element> createIterator(ExecutionContext context)
          Get the iterator to use for the iteration.
 int getNumIterations()
           
 void initialize(Element element)
          Initializes this scheduler.
 boolean selectNextElement(ExecutionContext context)
           
 void setNumIterations(int numIterations)
           
 
Methods inherited from class ch.tatool.core.element.AbstractListSelector
getExecutionElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratedListSelector

public IteratedListSelector()

IteratedListSelector

public IteratedListSelector(int numberOfIterations)
Method Detail

initialize

public void initialize(Element element)
Initializes this scheduler.

Specified by:
initialize in interface Initializable
Overrides:
initialize in class AbstractListSelector

selectNextElement

public boolean selectNextElement(ExecutionContext context)

canCreateIterator

protected boolean canCreateIterator()
Returns whether a new iterator can be created.


canExecuteNext

protected boolean canExecuteNext()
Can a next element be executed. By default we execute full iterations, so this method by default returns true


createIterator

protected Iterator<Element> createIterator(ExecutionContext context)
Get the iterator to use for the iteration.


getNumIterations

public int getNumIterations()

setNumIterations

public void setNumIterations(int numIterations)


Copyright © 2012. All Rights Reserved.