OptaPlanner core 6.2.0.CR2

org.optaplanner.core.impl.heuristic.selector.common.iterator
Class UpcomingSelectionIterator<S>

java.lang.Object
  extended by org.optaplanner.core.impl.heuristic.selector.common.iterator.SelectionIterator<S>
      extended by org.optaplanner.core.impl.heuristic.selector.common.iterator.UpcomingSelectionIterator<S>
Type Parameters:
S -
All Implemented Interfaces:
Iterator<S>
Direct Known Subclasses:
AbstractOriginalSwapIterator, AbstractRandomSwapIterator, CartesianProductMoveSelector.OriginalCartesianProductMoveIterator

public abstract class UpcomingSelectionIterator<S>
extends SelectionIterator<S>

IMPORTANT: The constructor of any subclass of this abstract class, should never call any of its child Selector's Iterator.hasNext() or Iterator.next() methods, because that can cause descendant Selectors to be selected too early (which breaks MimicReplayingEntitySelector).


Field Summary
protected  boolean hasUpcomingSelection
           
protected  boolean upcomingCreated
           
protected  S upcomingSelection
           
 
Constructor Summary
UpcomingSelectionIterator()
           
 
Method Summary
protected abstract  S createUpcomingSelection()
           
 boolean hasNext()
           
 S next()
           
protected  S noUpcomingSelection()
           
 String toString()
           
 
Methods inherited from class org.optaplanner.core.impl.heuristic.selector.common.iterator.SelectionIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

upcomingCreated

protected boolean upcomingCreated

hasUpcomingSelection

protected boolean hasUpcomingSelection

upcomingSelection

protected S upcomingSelection
Constructor Detail

UpcomingSelectionIterator

public UpcomingSelectionIterator()
Method Detail

hasNext

public boolean hasNext()

next

public S next()

createUpcomingSelection

protected abstract S createUpcomingSelection()

noUpcomingSelection

protected S noUpcomingSelection()

toString

public String toString()
Overrides:
toString in class Object

OptaPlanner core 6.2.0.CR2

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.