Package org.eclipse.search.ui.text
Class Match
java.lang.Object
org.eclipse.search.ui.text.Match
A textual match in a given object. This class may be instantiated and also subclassed (to add
 additional match state like accuracy, etc). The element a match is reported
 against is assumed to contain the match, and the UI will group matches
 against the same element together. A match has an offset and a length which
 may be specified in characters or in lines.
- Since:
- 3.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intA constant expressing that offset and length of this match are specified in charactersstatic final intA constant expressing that offset and length of this match are specified in lines
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintReturns whether match length and offset are expressed in lines or characters.Returns the element that contains this match.intReturns the length of this match.intReturns the offset of this match.booleanReturns whether this match is filtered or not.voidsetFiltered(boolean value) Marks this match as filtered or not.voidsetLength(int length) Sets the length.voidsetOffset(int offset) Sets the offset of this match.toString()for debug only
- 
Field Details- 
UNIT_LINEpublic static final int UNIT_LINEA constant expressing that offset and length of this match are specified in lines- See Also:
 
- 
UNIT_CHARACTERpublic static final int UNIT_CHARACTERA constant expressing that offset and length of this match are specified in characters- See Also:
 
 
- 
- 
Constructor Details- 
MatchConstructs a new Match object.- Parameters:
- element- the element that contains the match
- unit- the unit offset and length are based on
- offset- the offset the match starts at
- length- the length of the match
 
- 
MatchConstructs a new Match object. The offset and length will be based on characters.- Parameters:
- element- the element that contains the match
- offset- the offset the match starts at
- length- the length of the match
 
 
- 
- 
Method Details- 
getOffsetpublic int getOffset()Returns the offset of this match.- Returns:
- the offset
 
- 
setOffsetpublic void setOffset(int offset) Sets the offset of this match.- Parameters:
- offset- the offset to set
 
- 
getLengthpublic int getLength()Returns the length of this match.- Returns:
- the length
 
- 
setLengthpublic void setLength(int length) Sets the length.- Parameters:
- length- the length to set
 
- 
getElementReturns the element that contains this match. The element is used to group the match.- Returns:
- the element that contains this match
 
- 
getBaseUnitpublic int getBaseUnit()Returns whether match length and offset are expressed in lines or characters.- Returns:
- either UNIT_LINE or UNIT_CHARACTER;
 
- 
setFilteredpublic void setFiltered(boolean value) Marks this match as filtered or not.- Parameters:
- value-- trueif the match is filtered; otherwise- false
- Since:
- 3.1
 
- 
isFilteredpublic boolean isFiltered()Returns whether this match is filtered or not.- Returns:
- trueif the match is filtered; otherwise- false
- Since:
- 3.1
 
- 
toStringfor debug only
 
-