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.subsystems.files.core.subsystems
Class RemoteSearchResult

java.lang.Object
  extended by 
org.eclipse.rse.subsystems.files.core.subsystems.RemoteSearchResult
All Implemented Interfaces:
IAdaptable, IRemoteLineReference, IHostSearchResult, IRemoteSearchResult

public class RemoteSearchResult
extends Object
implements IAdaptable, IRemoteSearchResult

The RemoteSearchResultImpl class is an implementation of IRemoteSearchResult. It is used for storing information about a particular search result.


Nested Class Summary
protected  class RemoteSearchResult.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
RemoteSearchResult ( 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 ()
          Returns the char start offset of the first match.
 int getCharEnd (int matchIndex)
          Gets the char end offset for the given match index.
 int getCharStart ()
          Returns the char end offset of the first match.
 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 ()
          Gets the line number within a file that this references if it references any.
  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

RemoteSearchResult

public RemoteSearchResult(
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
Specified by:
getText in interface IRemoteSearchResult
Returns:
the text.
See Also:
IRemoteSearchResult.getText()

getLine

public int getLine()
Description copied from interface: IRemoteLineReference
Gets the line number within a file that this references if it references any. By default it should return 0. If no file association exists, it also returns 0. This may be used to jump into a location within an editor from a view which displays remote output.

Specified by:
getLine in interface IRemoteLineReference
Specified by:
getLine in interface IHostSearchResult
Returns:
the line number within a referenced file if there is one.
See Also:
IRemoteLineReference.getLine()

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
Specified by:
getIndex in interface IRemoteSearchResult
Returns:
the index.
See Also:
IRemoteSearchResult.getIndex()

getAbsolutePath

public 
String getAbsolutePath()
Gets the absolute path of the file for which the result was found.

Specified by:
getAbsolutePath in interface IRemoteLineReference
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 IRemoteLineReference
Specified by:
getParent in interface IHostSearchResult
Returns:
the containing parent.

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
Specified by:
getMatchingSearchString in interface IRemoteSearchResult
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
Specified by:
addMatch in interface IRemoteSearchResult
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
Specified by:
numOfMatches in interface IRemoteSearchResult
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
Specified by:
getCharStart in interface IRemoteSearchResult
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
Specified by:
getCharEnd in interface IRemoteSearchResult
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.

Specified by:
getCharEnd in interface IRemoteLineReference
Returns:
the offset
See Also:
IRemoteLineReference.getCharEnd()

getCharStart

public int getCharStart()
Returns the char end offset of the first match.

Specified by:
getCharStart in interface IRemoteLineReference
Returns:
the offset
See Also:
IRemoteLineReference.getCharStart()

getConfiguration

public 
IHostSearchResultConfiguration getConfiguration()
Specified by:
getConfiguration in interface IHostSearchResult

setParent

public void setParent(
Object parent)
Specified by:
setParent 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