| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.core.output.text.TextPartUtil |
Class containing utility methods to operate on parts of text documents.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| TextPartUtil() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static String |
buildRawTextFromPart(ITextDocumentPart part)
Build the textual representation of a part.
| ||||||||||
| static String |
buildRawTextFromPartInterruptibly(ITextDocumentPart part)
Build the textual representation of a part.
| ||||||||||
| static int |
coordinatesToLineIndex(ITextDocumentPart part, ICoordinates coord)
Compute the part-relative index of a line given its coordinates.
| ||||||||||
| static IAnchor |
getAnchorAtLine(ITextDocumentPart part, int lineIndex)
Retrieve the document anchor at the provided line.
| ||||||||||
| static IAnchor |
getAnchorById(ITextDocumentPart part, long anchorId)
Get the anchor that has the exact provided id.
| ||||||||||
| static IAnchor |
getApproximateAnchorById(ITextDocumentPart part, long anchorId, int mode)
Get the anchor that has the provided id, or if none is found, one if its neighbor (not
necessarily the closest neighbor).
| ||||||||||
| static IAnchor |
getFirstAnchor(ITextDocumentPart part)
Determine the first anchor of the provided part.
| ||||||||||
| static long |
getFirstAnchorId(ITextDocumentPart part)
Determine the id of the first anchor of the provided part.
| ||||||||||
| static ITextItem |
getItemAt(ILine line, int offset)
Get the item at the given offset of the given line.
| ||||||||||
| static ITextItem |
getItemAt(ITextDocumentPart part, int lineIndex, int offset)
Get the item at the given offset of the given line.
| ||||||||||
| static List<ITextItem> |
getItems(ITextDocumentPart part)
Retrieve all items of a part.
| ||||||||||
| static IAnchor |
getLastAnchor(ITextDocumentPart part)
Determine the last inclusive anchor of the provided part.
| ||||||||||
| static long |
getLastAnchorId(ITextDocumentPart part)
Determine the id of the last anchor of the provided part.
| ||||||||||
| static ILine | getLineAt(ITextDocumentPart part, ICoordinates coord) | ||||||||||
| static List<? extends ILine> |
getLinesOfAnchor(ITextDocumentPart part, long anchorId)
Get the lines that belong to a specific anchor of a text part.
| ||||||||||
| static IAnchor |
getNearestAnchorById(ITextDocumentPart part, long anchorId)
Get the anchor that has the closest id to the requested id.
| ||||||||||
| static long |
getNextAnchorId(ITextDocumentPart part)
Determine the id of the first anchor of the next (contiguous, possibly virtual) part.
| ||||||||||
| static boolean | isAnchorDisplayed(ITextDocumentPart part, long anchorId) | ||||||||||
| static boolean |
isInsidePart(ITextDocumentPart part, ICoordinates coord)
Determine if the provided coordinates are inside a document part.
| ||||||||||
| static void |
verifyPart(ITextDocumentPart part)
Verify the partial correctness of a part.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Build the textual representation of a part.
| part | the part |
|---|
Build the textual representation of a part. This routine throws InterruptedException if the executing thread is interrupted.
| part | the part |
|---|
| InterruptedException | if the executing thread is interrupted. |
|---|
Compute the part-relative index of a line given its coordinates.
| part | the part |
|---|---|
| coord | some coordinates |
Retrieve the document anchor at the provided line.
| lineIndex | a line index within the part |
|---|
Get the anchor that has the exact provided id.
| part | the part |
|---|---|
| anchorId | the anchor identifier |
"anchor id", or null
Get the anchor that has the provided id, or if none is found, one if its neighbor (not necessarily the closest neighbor). The neighbor is determined by the `mode` parameter.
| part | the part |
|---|---|
| anchorId | the requested anchor identifier |
| mode | in effect only if no exact anchor was found - 0= nearest neighbor; 1= the right nearest neighbor; -1: the left nearest neighbor |
Determine the first anchor of the provided part.
| part | a part |
|---|
Determine the id of the first anchor of the provided part.
| part | a part |
|---|
Get the item at the given offset of the given line.
| line | part line object |
|---|---|
| offset | an offset that belongs to the item |
Get the item at the given offset of the given line.
| part | the part |
|---|---|
| lineIndex | a line index within the part |
| offset | an offset that belongs to the item |
Determine the last inclusive anchor of the provided part. The returned anchor is guaranteed to reference lines that are in the document part.
| part | a part |
|---|
Determine the id of the last anchor of the provided part.
| part | a part |
|---|
Get the lines that belong to a specific anchor of a text part.
| part | the part |
|---|---|
| anchorId | the anchor |
Get the anchor that has the closest id to the requested id.
Note: usual integer distance calculation takes place.
| part | the part |
|---|---|
| anchorId | the requested anchor identifier |
Determine the id of the first anchor of the next (contiguous, possibly virtual) part.
| part | the current part |
|---|
Determine if the provided coordinates are inside a document part.
| part | a part |
|---|---|
| coord | some text coordinates |
Verify the partial correctness of a part. A correct part will pass this test; however, passing this test does not mean the part is correct.
| part | the part to be tested |
|---|