All classes, interface and methods mentioned in this chapter are marked as deprecated in the API documentation and will be removed with version 1.0.
All classes of this package are deprecated and will be replaced by other classes and interfaces. The next paragraphs will describe how to migrate your code to the new classes.
The package org.xshare.base.iterator.helpers contains the CountingIterator, which is marked since vesion 0.20 as deprecated You can find a identical copy this class also in the org.xshare.base.iterator package. It has there the same name and its functionality is identical. The CountingIterator will be moved only to cleanup a little bit the package structure.
The Functor is obsolete and can be replaced by the Closure interface from the org.xshare.base.operation package. To support the migration from Functor to Closure, the Functor is extending the Closure now. You simply have to replace the interfacename and to adjust the import statements.
The IteratorHaunter will be replaced by the helper class ForAll from the org.xshare.base.collections.helpers package and its static mehod exec(Iterator, Closure).
To migrate the following code code, you have to do following:
IteratorHaunter ih = new IteratorHaunter(col.iterator(), new Functor() { public void function() { ... } }); ih.run();
Instead of creating a new IteratorHaunter pass the iteration and the Functor to ForAll.exec(...).
ForAll.exec(col.iterator(), new Functor() { public void function() { ... } });
Since the Functor is also deprecated, it has to be replaced by Closure.
ForAll.exec(col.iterator(), new Closure() { public void function() { ... } });
That is all.
To start the execution of a given IteratorHaunter you have to call the run() method, while the execution of a Closure to ForAll.exec(...) starts instantly.