com.itextpdf.text.pdf.parser
Class LocationTextExtractionStrategy.TextChunk
java.lang.Object
com.itextpdf.text.pdf.parser.LocationTextExtractionStrategy.TextChunk
- All Implemented Interfaces:
- Comparable<LocationTextExtractionStrategy.TextChunk>
- Enclosing class:
- LocationTextExtractionStrategy
public static class LocationTextExtractionStrategy.TextChunk
- extends Object
- implements Comparable<LocationTextExtractionStrategy.TextChunk>
Represents a chunk of text, it's orientation, and location relative to the orientation vector
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocationTextExtractionStrategy.TextChunk
public LocationTextExtractionStrategy.TextChunk(String string,
Vector startLocation,
Vector endLocation,
float charSpaceWidth)
getStartLocation
public Vector getStartLocation()
- Returns:
- the start location of the text
getEndLocation
public Vector getEndLocation()
- Returns:
- the end location of the text
getText
public String getText()
- Returns:
- the text captured by this chunk
getCharSpaceWidth
public float getCharSpaceWidth()
- Returns:
- the width of a single space character as rendered by this chunk
sameLine
public boolean sameLine(LocationTextExtractionStrategy.TextChunk as)
- Parameters:
as
- the location to compare to
- Returns:
- true is this location is on the the same line as the other
distanceFromEndOf
public float distanceFromEndOf(LocationTextExtractionStrategy.TextChunk other)
- Computes the distance between the end of 'other' and the beginning of this chunk
in the direction of this chunk's orientation vector. Note that it's a bad idea
to call this for chunks that aren't on the same line and orientation, but we don't
explicitly check for that condition for performance reasons.
- Parameters:
other
-
- Returns:
- the number of spaces between the end of 'other' and the beginning of this chunk
compareTo
public int compareTo(LocationTextExtractionStrategy.TextChunk rhs)
- Compares based on orientation, perpendicular distance, then parallel distance
- Specified by:
compareTo
in interface Comparable<LocationTextExtractionStrategy.TextChunk>
- See Also:
Comparable.compareTo(java.lang.Object)
Copyright © 2013. All Rights Reserved.