|
IBM Rational Performance Tester SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.rational.common.test.editor.framework.kernel.search.SearchComparator
com.ibm.rational.common.test.editor.framework.search.BasicSearchComparator
public abstract class BasicSearchComparator
Recommended class to be used with Test Search.
Constructor Summary | |
---|---|
BasicSearchComparator(com.ibm.rational.common.test.editor.framework.kernel.search.SearchParameters parameters)
|
Method Summary | |
---|---|
boolean |
_old_doSearch(Object object,
com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs,
com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
Default implementation of ISearchComparator.doSearch(Object, QuerySpecification, SearchResult) . |
protected void |
addElementMatch(Object element,
com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
Utility method creates an instance of SearchMatch for a given element and calls
SearchComparator.incCounter(int) . |
protected void |
addMatches(List matches,
com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
Utility method creates and adds matches contained in the matches argument to the result and increments
counter. |
void |
chainComparator(com.ibm.rational.common.test.editor.framework.kernel.search.ISearchComparator comparator)
|
protected com.ibm.rational.common.test.editor.framework.kernel.search.SearchMatch |
createSearchMatch(Object element,
String fieldName,
String id,
IRegion r)
Returns search match for input data or null if a match cannot be created (for example, due to preference settings). |
protected com.ibm.rational.common.test.editor.framework.extensions.TextSearcher |
createTextSearcher(String text)
Returns new instance of TextSearcher |
boolean |
doSearch(Object object,
com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs,
com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
|
protected abstract com.ibm.rational.common.test.editor.framework.kernel.search.IPreviewProvider |
getPreviewProvider()
|
protected com.ibm.rational.common.test.editor.framework.extensions.TextSearcher |
getTextSearcher(String text)
Returns an existing instance of TextSearcher or calls BasicSearchComparator.createTextSearcher(String) to get an instance
for the first time. |
protected List |
searchForSubstrings(Object element,
String text,
String search,
boolean caseSensitive,
String fieldName,
String id)
Utility method that performs search in a given field. |
boolean |
shouldSearch(Object object,
com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs)
|
Methods inherited from class com.ibm.rational.common.test.editor.framework.kernel.search.SearchComparator |
---|
getCounter, getParameters, getQuerySpecification, incCounter, isEmpty, resetCounter, setParameters, setQuerySpecification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.rational.common.test.editor.framework.kernel.search.ISearchComparator |
---|
initParameters |
Constructor Detail |
---|
public BasicSearchComparator(com.ibm.rational.common.test.editor.framework.kernel.search.SearchParameters parameters)
parameters
- Method Detail |
---|
public boolean _old_doSearch(Object object, com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs, com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
ISearchComparator.doSearch(Object, QuerySpecification, SearchResult)
.
Downstream classes are expected to overwrite this method to perform their specific search and call this method
to allow any possible contributors to execute the search as well.
ISearchComparator.doSearch(java.lang.Object, com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification, com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult)
,
ISearchOptionsContributor}
public boolean doSearch(Object object, com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs, com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
public boolean shouldSearch(Object object, com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs)
shouldSearch
in interface com.ibm.rational.common.test.editor.framework.kernel.search.ISearchComparator
shouldSearch
in class com.ibm.rational.common.test.editor.framework.kernel.search.SearchComparator
protected List searchForSubstrings(Object element, String text, String search, boolean caseSensitive, String fieldName, String id)
element
- Object
Model Elementtext
- String
Field valuesearch
- String
text to findcaseSensitive
- boolean perform case-sensitive searchfieldName
- String
field nameid
- String
field ID
SearchMatch
's.SearchComparator.getQuerySpecification()
to extract the regex
parameter
in order to support regular expression search.BasicSearchComparator.getTextSearcher(String)
,
BasicSearchComparator.createSearchMatch(Object, String, String, IRegion)
protected com.ibm.rational.common.test.editor.framework.kernel.search.SearchMatch createSearchMatch(Object element, String fieldName, String id, IRegion r)
null
if a match cannot be created (for example, due to preference settings).
element
- CBActionElement
model elementfieldName
- String. Translated name of the attribute field. This is visible in GUI.id
- String. Field idr
- IRegion
. Region with offset and length of the match
SearchMatch
or derived class, or null
.protected com.ibm.rational.common.test.editor.framework.extensions.TextSearcher getTextSearcher(String text)
TextSearcher
or calls BasicSearchComparator.createTextSearcher(String)
to get an instance
for the first time. If the search already exists, calls TextSearcher.setSearchText(String)
text
- String
text to search for.
TextSearcher
protected com.ibm.rational.common.test.editor.framework.extensions.TextSearcher createTextSearcher(String text)
TextSearcher
text
- String
text to search for.
TextSearcher
BasicSearchComparator.createTextSearcher(String)
,
BasicSearchComparator.createSearchMatch(Object, String, String, IRegion)
protected abstract com.ibm.rational.common.test.editor.framework.kernel.search.IPreviewProvider getPreviewProvider()
protected void addMatches(List matches, com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
matches
argument to the result
and increments
counter.
matches
- List
result
- SearchResult
SearchMatch
,
SearchComparator.incCounter(int)
protected void addElementMatch(Object element, com.ibm.rational.common.test.editor.framework.kernel.search.SearchResult result)
SearchMatch
for a given element
and calls
SearchComparator.incCounter(int)
.
element
- Object model elementresult
- SearchResult
result.public void chainComparator(com.ibm.rational.common.test.editor.framework.kernel.search.ISearchComparator comparator)
|
IBM Rational Performance Tester SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |