org.openidex.util/3 3.34

org.openidex.search
Interface SearchInfo

All Known Subinterfaces:
SearchInfo.Files

public interface SearchInfo

Defines which DataObjects should be searched. Iterator returned by this interface's method enumerates DataObjects that should be searched.

SearchInfo objects are used by module User Utilities – in actions Find (since User Utilities 1.16) and Find in Projects (since User Utilities 1.23). Action Find obtains SearchInfo from Lookup of nodes the action was invoked on. Action Find in Projects obtains SearchInfo from Lookup of the projects.

Recommendation: Use SearchInfo.Files instead of this interface. See objectsToSearch() and SearchInfo.Files.filesToSearch().

Since:
org.openidex.util/3 3.2
See Also:
SearchInfoFactory, DataObject, Node.getLookup(), Project.getLookup()

Nested Class Summary
static interface SearchInfo.Files
          Additionally defines which FileObjects should be searched.
 
Method Summary
 boolean canSearch()
          Determines whether the object which provided this SearchInfo can be searched.
 Iterator<DataObject> objectsToSearch()
          Specifies which DataObjects should be searched.
 

Method Detail

canSearch

boolean canSearch()
Determines whether the object which provided this SearchInfo can be searched. This method determines whether the Find action should be enabled for the object or not.

This method must be very quick as it may be called frequently and its speed may influence responsiveness of the whole application. If the exact algorithm for determination of the result value should be slow, it is better to return true than make the method slow.

Returns:
false if the object is known that it cannot be searched; true otherwise
Since:
org.openidex.util/3 3.3

objectsToSearch

Iterator<DataObject> objectsToSearch()
Specifies which DataObjects should be searched. The returned Iterator needn't implement method remove() (i.e. it may throw UnsupportedOperationException instead of actual implementation).

Recommendation: Use interface SearchInfo.Files and its method SearchInfo.Files.filesToSearch(). It avoids unnecessary creation of DataObjects, so searching works faster and consumes less memory.

Returns:
iterator which iterates over DataObjects to be searched

org.openidex.util/3 3.34

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.