Utils
+ Class Utils
made public with one public static method
+ getFileObjectsIterator(SearchInfo si)
. This utility
+ method returns Iterator
of FileObject
s
+ for the provided SearchInfo
. This change simplifies
+ the work with SearchInfo
implementations.
+
SearchInfo.Files
+ Added SearchInfo.Files
interface which extends
+ SearchInfo
interface. It adds method
+ filesToSearch()
to provide FileObject
s
+ which should be searched. This change allows to operate FileObject
s
+ in the search mechanism instead of DataObject
s and
+ as a result improves search performance.
+
FileObject
s should be searched.
+ *
+ * @since org.openidex.util/3 3.20
+ * @author kaktus
+ */
+ public interface Files extends SearchInfo{
+
+ /**
+ * Specifies which FileObject
s should be searched.
+ * The returned Iterator
needn't implement method
+ * {@link java.util.Iterator#remove remove()} (i.e. it may throw
+ * UnsupportedOperationException
instead of actual
+ * implementation).
+ *
+ * @return iterator which iterates over FileObject
s
+ * to be searched
+ */
+ public IteratorDataObject
to be returned the next time method
* {@link #next()} is called
*/
- private DataObject nextObject;
+ private FileObject nextObject;
/**
*/
SimpleSearchIterator(DataFolder folder,
boolean recursive,
ListIterator
of FileObject
's for the provided SearchInfo
.
+ * If provided SearchInfo
object is implementation of SearchInfo.Files
interface
+ * then the result of method SearchInfo.Files.filesToSearch
is returned. Otherwise the objects
+ * are getting from the SearchInfo.objectsToSearch
method.
+ *
+ * @param si SearchInfo
object to return the iterator for
+ * @return iterator which iterates over FileObject
s
+ * @since org.openidex.util/3 3.20
+ */
+ public static Iterator