org.drools.repository
Class ModuleHistoryIterator

java.lang.Object
  extended by org.drools.repository.ModuleHistoryIterator
All Implemented Interfaces:
Iterator<ModuleItem>

public class ModuleHistoryIterator
extends Object
implements Iterator<ModuleItem>

A lazy iterator for walking back through history. Wraps the version iterator from JCR and allows skipping.


Constructor Summary
ModuleHistoryIterator(RulesRepository rulesRepository, javax.jcr.Node head)
           
 
Method Summary
 boolean hasNext()
           
 ModuleItem next()
           
 void remove()
          You can't do this with this sort of iterator.
 void skip(int i)
          Skip the specified number of items.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleHistoryIterator

public ModuleHistoryIterator(RulesRepository rulesRepository,
                             javax.jcr.Node head)
Method Detail

hasNext

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

next

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

remove

public void remove()
You can't do this with this sort of iterator. It makes no sense to remove a history item. Removing history is a administrative function only (and in any case, it may have to be archived for legal reasons).

Specified by:
remove in interface Iterator<ModuleItem>
Throws:
UnsupportedOperationException - when called.

skip

public void skip(int i)
Skip the specified number of items. As this is a lazy iterator this means less work in pulling it from the database etc.



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