Package com.itextpdf.text.pdf.parser
Class LocationTextExtractionStrategy.TextChunkLocationDefaultImp
- java.lang.Object
-
- com.itextpdf.text.pdf.parser.LocationTextExtractionStrategy.TextChunkLocationDefaultImp
-
- All Implemented Interfaces:
LocationTextExtractionStrategy.TextChunkLocation
,java.lang.Comparable<LocationTextExtractionStrategy.TextChunkLocation>
- Enclosing class:
- LocationTextExtractionStrategy
public static class LocationTextExtractionStrategy.TextChunkLocationDefaultImp extends java.lang.Object implements LocationTextExtractionStrategy.TextChunkLocation
-
-
Constructor Summary
Constructors Constructor Description TextChunkLocationDefaultImp(Vector startLocation, Vector endLocation, float charSpaceWidth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(LocationTextExtractionStrategy.TextChunkLocation other)
float
distanceFromEndOf(LocationTextExtractionStrategy.TextChunkLocation other)
Computes the distance between the end of 'other' and the beginning of this chunk in the direction of this chunk's orientation vector.float
distParallelEnd()
float
distParallelStart()
int
distPerpendicular()
float
getCharSpaceWidth()
Vector
getEndLocation()
Vector
getStartLocation()
boolean
isAtWordBoundary(LocationTextExtractionStrategy.TextChunkLocation previous)
int
orientationMagnitude()
boolean
sameLine(LocationTextExtractionStrategy.TextChunkLocation as)
-
-
-
Method Detail
-
orientationMagnitude
public int orientationMagnitude()
- Specified by:
orientationMagnitude
in interfaceLocationTextExtractionStrategy.TextChunkLocation
-
distPerpendicular
public int distPerpendicular()
- Specified by:
distPerpendicular
in interfaceLocationTextExtractionStrategy.TextChunkLocation
-
distParallelStart
public float distParallelStart()
- Specified by:
distParallelStart
in interfaceLocationTextExtractionStrategy.TextChunkLocation
-
distParallelEnd
public float distParallelEnd()
- Specified by:
distParallelEnd
in interfaceLocationTextExtractionStrategy.TextChunkLocation
-
getStartLocation
public Vector getStartLocation()
- Specified by:
getStartLocation
in interfaceLocationTextExtractionStrategy.TextChunkLocation
- Returns:
- the start location of the text
-
getEndLocation
public Vector getEndLocation()
- Specified by:
getEndLocation
in interfaceLocationTextExtractionStrategy.TextChunkLocation
- Returns:
- the end location of the text
-
getCharSpaceWidth
public float getCharSpaceWidth()
- Specified by:
getCharSpaceWidth
in interfaceLocationTextExtractionStrategy.TextChunkLocation
- Returns:
- the width of a single space character as rendered by this chunk
-
sameLine
public boolean sameLine(LocationTextExtractionStrategy.TextChunkLocation as)
- Specified by:
sameLine
in interfaceLocationTextExtractionStrategy.TextChunkLocation
- 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.TextChunkLocation 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.- Specified by:
distanceFromEndOf
in interfaceLocationTextExtractionStrategy.TextChunkLocation
- Parameters:
other
-- Returns:
- the number of spaces between the end of 'other' and the beginning of this chunk
-
isAtWordBoundary
public boolean isAtWordBoundary(LocationTextExtractionStrategy.TextChunkLocation previous)
- Specified by:
isAtWordBoundary
in interfaceLocationTextExtractionStrategy.TextChunkLocation
-
compareTo
public int compareTo(LocationTextExtractionStrategy.TextChunkLocation other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<LocationTextExtractionStrategy.TextChunkLocation>
-
-