org.eclipse.rse.services.search
Class AbstractSearchResult
java.lang.Object
org.eclipse.rse.services.search.AbstractSearchResult
-
All Implemented Interfaces:
-
IAdaptable,
IHostSearchResult
-
public class AbstractSearchResult
- extends
Object
- implements
IAdaptable,
IHostSearchResult
The RemoteSearchResultImpl class is an implementation of IRemoteSearchResult.
It is used for storing information about a particular search result.
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
AbstractSearchResult
public AbstractSearchResult(
IHostSearchResultConfiguration configuration,
Object parent,
SystemSearchString searchString)
- Constructor to create a result.
-
Parameters:
-
parent
- container of the result. -
searchString
- the search string for which the result was produced.
setText
public void setText(
String text)
- Sets the displayable text for the search result.
-
-
-
Parameters:
-
text
- the displayable text.
setLine
public void setLine(int line)
- Sets the associated line number for the result.
-
-
-
Parameters:
-
line
- the line number.
setIndex
public void setIndex(int index)
- Sets the index of the search result in the context of its parent.
-
-
-
Parameters:
-
index
- the index.
getText
public
String getText()
-
Description copied from interface:
IHostSearchResult
- Gets the text to display for a search result.
-
-
Specified by:
-
getText
in interface
IHostSearchResult
-
-
Returns:
- the text.
getLine
public int getLine()
-
-
Specified by:
-
getLine
in interface
IHostSearchResult
-
getIndex
public int getIndex()
-
Description copied from interface:
IHostSearchResult
- Gets the index of this search result in the context of its parent.
-
-
Specified by:
-
getIndex
in interface
IHostSearchResult
-
-
Returns:
- the index.
getAbsolutePath
public
String getAbsolutePath()
- Gets the absolute path of the file for which the result was found.
-
-
Specified by:
-
getAbsolutePath
in interface
IHostSearchResult
-
-
Returns:
- the absolute path of the file.
getParent
public
Object getParent()
- Gets the containing object for the search result.
-
-
Specified by:
-
getParent
in interface
IHostSearchResult
-
-
Returns:
- the containing parent.
setParent
public void setParent(
Object parent)
-
-
Specified by:
-
setParent
in interface
IHostSearchResult
-
getAdapter
public
Object getAdapter(
Class adapterType)
- Gets the associated adapter for this search result.
-
-
Specified by:
-
getAdapter
in interface
IAdaptable
-
-
Parameters:
-
adapterType
- the adapter type.
getChildren
public
Object[] getChildren()
- Returns children of the search result, if applicable.
-
-
-
Returns:
-
null
for this implementation.
hasChildren
public boolean hasChildren()
- Indicates whether this search result has children
-
-
-
Returns:
-
false
since there are no children.
getLabel
public
String getLabel()
- Gets the displayable label for this output. Calls getText().
-
-
-
Returns:
- the label.
getMatchingSearchString
public
SystemSearchString getMatchingSearchString()
- Gets the search string that this result matches.
-
-
Specified by:
-
getMatchingSearchString
in interface
IHostSearchResult
-
-
Returns:
- the search string.
addMatch
public void addMatch(int startOffset,
int endOffset)
- Add a match to the result. A match comprises a char start offset and a char end offset, both
relative to the beginning of the file. The matches are added in order.
-
-
Specified by:
-
addMatch
in interface
IHostSearchResult
-
-
Parameters:
-
startOffset
- the char start offset, from the beginning of the file. -
endOffset
- the char end offset, from the beginning of the file.
numOfMatches
public int numOfMatches()
- Gets the number of matches in this line.
-
-
Specified by:
-
numOfMatches
in interface
IHostSearchResult
-
-
Returns:
- the number of matches.
getCharStart
public int getCharStart(int matchIndex)
- Gets the char start offset for the given match index.
-
-
Specified by:
-
getCharStart
in interface
IHostSearchResult
-
-
Parameters:
-
matchIndex
- the match index. For example, to get the start offset for the first match, specify 0.
-
Returns:
- the char start offset, or -1 if there is no match corresponding to the given index.
getCharEnd
public int getCharEnd(int matchIndex)
- Gets the char end offset for the given match index.
-
-
Specified by:
-
getCharEnd
in interface
IHostSearchResult
-
-
Parameters:
-
matchIndex
- the match index. For example, to get the end offset for the first match, specify 0.
-
Returns:
- the char end offset, or -1 if there is no match corresponding to the given index.
getCharEnd
public int getCharEnd()
-
-
-
Returns:
- the char start offset of the first match.
getCharStart
public int getCharStart()
-
-
-
Returns:
- the char end offset of the first match.
getConfiguration
public
IHostSearchResultConfiguration getConfiguration()
-
-
Specified by:
-
getConfiguration
in interface
IHostSearchResult
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.