Package technology.tabula
Class TextChunk
- All Implemented Interfaces:
Shape,Serializable,Cloneable,HasText
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float -
Field Summary
FieldsFields inherited from class technology.tabula.RectangularTextContainer
textElementsFields inherited from class technology.tabula.Rectangle
ILL_DEFINED_ORDER, VERTICAL_COMPARISON_THRESHOLDFields inherited from class java.awt.geom.Rectangle2D.Float
height, width, x, yFields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP -
Constructor Summary
ConstructorsConstructorDescriptionTextChunk(float top, float left, float width, float height) TextChunk(List<TextElement> textElements) TextChunk(TextElement textElement) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(List<TextElement> elements) voidadd(TextElement textElement) static booleanallSameChar(List<TextChunk> textChunks) booleangetText()getText(boolean useLineReturns) groupByDirectionality(Boolean isLtrDominant) Splits a TextChunk into N TextChunks, where each chunk is of a single directionality, and then reverse the RTL ones.groupByLines(List<TextChunk> textChunks) inthashCode()intbooleanReturns true if text contained in this TextChunk is the same repeated characterbooleanisSameChar(Character[] c) splitAt(int i) Splits a TextChunk in two, at the position of the i-th TextElementRemoves runs of identical TextElements in this TextChunk For example, if the TextChunk contains this string of characters: "1234xxxxx56xx" and c == 'x' and minRunLength == 4, this method will return a list of TextChunk such that: ["1234", "56xx"]Methods inherited from class technology.tabula.RectangularTextContainer
getTextElements, merge, setTextElements, toStringMethods inherited from class technology.tabula.Rectangle
boundingBoxOf, compareTo, getArea, getBottom, getLeft, getPoints, getRight, getTop, horizontallyOverlaps, horizontalOverlap, merge, overlapRatio, setBottom, setLeft, setRight, setTop, verticallyOverlaps, verticalOverlap, verticalOverlapRatioMethods inherited from class java.awt.geom.Rectangle2D.Float
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect, setRectMethods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, unionMethods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
-
Field Details
-
EMPTY
-
-
Constructor Details
-
TextChunk
public TextChunk(float top, float left, float width, float height) -
TextChunk
-
TextChunk
-
-
Method Details
-
groupByDirectionality
Splits a TextChunk into N TextChunks, where each chunk is of a single directionality, and then reverse the RTL ones. what we're doing here is *reversing* the Unicode bidi algorithm in the language of that algorithm, each chunk is a (maximal) directional run. We attach whitespace to the beginning of non-RTL -
isLtrDominant
public int isLtrDominant()- Overrides:
isLtrDominantin classRectangle
-
merge
-
add
-
add
-
getText
- Specified by:
getTextin interfaceHasText- Overrides:
getTextin classRectangularTextContainer<TextElement>
-
getText
- Specified by:
getTextin interfaceHasText- Overrides:
getTextin classRectangularTextContainer<TextElement>
-
isSameChar
Returns true if text contained in this TextChunk is the same repeated character -
isSameChar
-
splitAt
Splits a TextChunk in two, at the position of the i-th TextElement -
squeeze
Removes runs of identical TextElements in this TextChunk For example, if the TextChunk contains this string of characters: "1234xxxxx56xx" and c == 'x' and minRunLength == 4, this method will return a list of TextChunk such that: ["1234", "56xx"] -
hashCode
public int hashCode()- Overrides:
hashCodein classRectangle2D
-
equals
- Overrides:
equalsin classRectangle2D
-
allSameChar
-
groupByLines
-