org.drools.planner.core.heuristic.selector.common.iterator
Class CachedListRandomIterator<S>

java.lang.Object
  extended by org.drools.planner.core.heuristic.selector.common.iterator.CachedListRandomIterator<S>
Type Parameters:
S -
All Implemented Interfaces:
Iterator<S>

public class CachedListRandomIterator<S>
extends Object
implements Iterator<S>

This Iterator does not shuffle and is never ending.


Field Summary
protected  List<S> cachedList
           
protected  boolean notEmpty
           
protected  Random workingRandom
           
 
Constructor Summary
CachedListRandomIterator(List<S> cachedList, Random workingRandom)
           
 
Method Summary
 boolean hasNext()
           
 S next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedList

protected final List<S> cachedList

workingRandom

protected final Random workingRandom

notEmpty

protected final boolean notEmpty
Constructor Detail

CachedListRandomIterator

public CachedListRandomIterator(List<S> cachedList,
                                Random workingRandom)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<S>

next

public S next()
Specified by:
next in interface Iterator<S>

remove

public void remove()
Specified by:
remove in interface Iterator<S>


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