Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.services.search
Class AbstractSearchResult

java.lang.Object
  extended by 
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.


Nested Class Summary
protected  class AbstractSearchResult.RemoteSearchResultMatch
           
 
Field Summary
 
Fields inherited from interface org.eclipse.rse.services.search. IHostSearchResult
SEARCH_RESULT_CLOSE_DELIMITER, SEARCH_RESULT_DELIMITER, SEARCH_RESULT_INDEX_DELIMITER, SEARCH_RESULT_OPEN_DELIMITER
 
Constructor Summary
AbstractSearchResult ( IHostSearchResultConfiguration configuration, Object parent, SystemSearchString searchString)
          Constructor to create a result.
 
Method Summary
 void addMatch (int startOffset, int endOffset)
          Add a match to the result.
  String getAbsolutePath ()
          Gets the absolute path of the file for which the result was found.
  Object getAdapter ( Class adapterType)
          Gets the associated adapter for this search result.
 int getCharEnd ()
           
 int getCharEnd (int matchIndex)
          Gets the char end offset for the given match index.
 int getCharStart ()
           
 int getCharStart (int matchIndex)
          Gets the char start offset for the given match index.
  Object[] getChildren ()
          Returns children of the search result, if applicable.
  IHostSearchResultConfiguration getConfiguration ()
           
 int getIndex ()
          Gets the index of this search result in the context of its parent.
  String getLabel ()
          Gets the displayable label for this output.
 int getLine ()
           
  SystemSearchString getMatchingSearchString ()
          Gets the search string that this result matches.
  Object getParent ()
          Gets the containing object for the search result.
  String getText ()
          Gets the text to display for a search result.
 boolean hasChildren ()
          Indicates whether this search result has children
 int numOfMatches ()
          Gets the number of matches in this line.
 void setIndex (int index)
          Sets the index of the search result in the context of its parent.
 void setLine (int line)
          Sets the associated line number for the result.
 void setParent ( Object parent)
           
 void setText ( String text)
          Sets the displayable text for the search result.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire