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.
+
createCompoundSearchInfo(...)
diff -r e5bca2fae7c7 o.openidex.util/manifest.mf
--- a/o.openidex.util/manifest.mf Tue Jan 13 15:00:23 2009 +0100
+++ b/o.openidex.util/manifest.mf Tue Jan 13 20:08:22 2009 +0300
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
OpenIDE-Module: org.openidex.util/3
OpenIDE-Module-Localizing-Bundle: org/openidex/resources/Bundle.properties
-OpenIDE-Module-Specification-Version: 3.16
+OpenIDE-Module-Specification-Version: 3.20
AutoUpdate-Essential-Module: true
diff -r e5bca2fae7c7 o.openidex.util/src/org/openidex/search/CompoundSearchInfo.java
--- a/o.openidex.util/src/org/openidex/search/CompoundSearchInfo.java Tue Jan 13 15:00:23 2009 +0100
+++ b/o.openidex.util/src/org/openidex/search/CompoundSearchInfo.java Tue Jan 13 20:08:22 2009 +0300
@@ -45,13 +45,14 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import org.openide.filesystems.FileObject;
import org.openide.loaders.DataObject;
/**
*
* @author Marian Petras
*/
-class CompoundSearchInfo implements SearchInfo {
+class CompoundSearchInfo implements SearchInfo.Files {
/** */
private final SearchInfo[] elements;
@@ -88,8 +89,14 @@
/**
*/
public IteratorFileObject
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