Iteratorclasses (the "Java Collections API").
Array iterators can also go backwards and seek.
Object iterator interface.
Iterator interface for more than one return value.
Modifiable iterator, that also supports removal.
ELKI style Iterator for array lists.
Concatenate multiple iterators.
Empty object iterator.
ELKI style Iterator wrapper for collections.
ELKI uses a custom iterator API instead of the usual
Iterator classes (the "Java Collections API").
The reason for this is largely efficiency. Benchmarking showed that the Java
Iterator API can be quite expensive when dealing with primitive types, as
Iterator.next() is meant to always return an object.
However, the benefits become more apparent when considering multi-valued iterators. For example an iterator over a k nearest neighbor set in ELKI both represents an object by its DBID, and a distance value. For double-valued distances, it can be retrieved using a primitive value getter (saving an extra object copy), and since the iterator can be used as a DBIDRef, it can also represent the current object without creating additional objects.
While it may seem odd to depart from Java conventions such as the collections API, note that these iterators are very close to the standard C++ conventions, so nothing entirely unusual.
Copyright © 2019 ELKI Development Team. License information.