|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.fife.ui.rtextarea.SearchResult
public class SearchResult
The result of a find, replace, or "mark all" operation.
SearchEngine
Constructor Summary | |
---|---|
SearchResult()
Constructor; indicates no match is found. |
|
SearchResult(DocumentRange range,
int count,
int markedCount)
Constructor. |
Method Summary | |
---|---|
int |
compareTo(SearchResult other)
Compares this search result to another. |
boolean |
equals(java.lang.Object other)
Returns whether this search result represents the same logical result as another. |
int |
getCount()
Returns the number of matches found or replaced. |
int |
getMarkedCount()
Returns the number of instances marked. |
DocumentRange |
getMatchRange()
If a find or replace operation is successful, this will be the range of text representing the found text (for "find" operations) or the replacement text inserted (for "replace" operations; for "replace all" operations this will be the last replacement region). |
int |
hashCode()
Overridden simply as a best practice, since equals(Object) is
overridden. |
void |
setCount(int count)
Sets the number of matches found or replaced. |
void |
setMarkedCount(int markedCount)
Sets the number of marked occurrences found. |
void |
setMatchRange(DocumentRange range)
Sets the selected range for this search operation. |
java.lang.String |
toString()
Returns a string representation of this object. |
boolean |
wasFound()
Returns whether anything was found in this search operation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SearchResult()
public SearchResult(DocumentRange range, int count, int markedCount)
range
- The selected range of text after the find or replace
operation. This can be null
if the selection was
not changed.count
- The number of matches found or replaced. For regular
"find" and "replace" operations, this will be zero or
1
; for "replace all" operations, this will be the
number of replacements.markedCount
- The number of matches marked. If "mark all" is
disabled, this should be zero.Method Detail |
---|
public int compareTo(SearchResult other)
compareTo
in interface java.lang.Comparable<SearchResult>
other
- Another search result to compare to.
other
.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- Another object (presumably another
SearchResult
).public int getCount()
1
. For "replace
all" operations, this will be the number of replacements. For "mark
all" operations, this will be zero.
setCount(int)
public int getMarkedCount()
0
.
setMarkedCount(int)
public DocumentRange getMatchRange()
null
, since they do not update the editor's selection.
setMatchRange(DocumentRange)
public int hashCode()
equals(Object)
is
overridden.
hashCode
in class java.lang.Object
public void setCount(int count)
1
. For
"replace all" operations, this should be the number of replacements.
For "mark all" operations, this should be zero.
count
- The count.getCount()
public void setMarkedCount(int markedCount)
markedCount
- The number of marked occurrences found.getMarkedCount()
public void setMatchRange(DocumentRange range)
range
- The new selected range.getMatchRange()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean wasFound()
getCount()>0
.
getCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |