org.apache.pdfbox.text

## Class TextPositionComparator

- java.lang.Object
- - org.apache.pdfbox.text.TextPositionComparator

All Implemented Interfaces:
  Comparator<TextPosition>

    public class TextPositionComparator
    extends Object
    implements Comparator<TextPosition>

This class is a comparator for TextPosition operators. It handles pages with text in different directions by grouping the text based on direction and sorting in that direction. This allows continuous text in a given direction to be more easily grouped together.

Author:
  Ben Litchfield

### Constructor Summary

Constructors
Constructor and Description
`TextPositionComparator()`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compare(TextPosition pos1, TextPosition pos2)`

### 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

`comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

### Constructor Detail

#### TextPositionComparator

    public TextPositionComparator()

### Method Detail

#### compare

    public int compare(TextPosition pos1,
                       TextPosition pos2)

Specified by:
  `compare` in interface `Comparator<TextPosition>`