org.drools.repository
Class AssetHistoryIterator

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

public class AssetHistoryIterator
extends Object
implements Iterator<AssetItem>

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


Constructor Summary
AssetHistoryIterator(RulesRepository repo, javax.jcr.Node head)
           
 
Method Summary
 boolean hasNext()
           
 AssetItem 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

AssetHistoryIterator

public AssetHistoryIterator(RulesRepository repo,
                            javax.jcr.Node head)
Method Detail

hasNext

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

next

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

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<AssetItem>
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-2012 JBoss by Red Hat. All Rights Reserved.