@Experimental public final class SearchResult extends Object implements Selection
Search
, if it has found something. It contains the searchString,
the text before and after the searchString, a reference to the Page in which the Result was
found, and the bounds of the Result. The text before and the text after the searchString can be null.Constructor and Description |
---|
SearchResult(String searchString,
String textPre,
String textAfter,
Selection selection) |
Modifier and Type | Method and Description |
---|---|
Rectangle2D |
getBounds()
returns the overall bounds of the selection.
|
Page |
getPage()
Provides the
Page this selection belongs to. |
String |
getSelectedText()
Provides the selected text.
|
Shape |
getShape()
Provides a graphical representation of this selection.
|
String |
getTextAfter() |
String |
getTextBefore() |
boolean |
isValid()
Return whether the selection is still valid.
|
String |
toString() |
public Rectangle2D getBounds()
Selection
Rectangle2D
is the smallest bounding box that encloses the Shape
s (returned by
Selection.getShape()
, only that the Shape
s lie entirely within the indicated
Rectangle2D
.public Shape getShape()
Selection
public Page getPage()
Selection
Page
this selection belongs to.public String getSelectedText()
Selection
getSelectedText
in interface Selection
public boolean isValid()
Selection
public String getTextBefore()
public String getTextAfter()
Copyright © 2024 levigo holding gmbh. All rights reserved.