|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.graphics.text.WordPositionComparator
public class WordPositionComparator
The WordPositionComparator is optionally called by text extraction algorithms to help insure words found in a line are ordered using the x coordinates of the bounding box in the cartesian plane's fourth quadrant. The sorting tries to order the word blocks via the coordinate system rather then the order that they were plotted in and thus shouldn't effect LTR or RTL writing formats.
It's assumed that all WordText that is a child of LineText will not be sorted on the y access. The class LinePositionComparator will be used to insure that lines are ordered correctly in the parent PageText array.
| Constructor Summary | |
|---|---|
WordPositionComparator()
|
|
| Method Summary | |
|---|---|
int |
compare(AbstractText lt1,
AbstractText lt2)
Compares the x coordinates of the AbstractText bounding box's x coordinate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public WordPositionComparator()
| Method Detail |
|---|
public int compare(AbstractText lt1,
AbstractText lt2)
compare in interface java.util.Comparator<AbstractText>lt1 - word text object to comparelt2 - word text object to compare
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||