Package org.apache.pdfbox.pdfparser.xref
Class NormalXReference
java.lang.Object
org.apache.pdfbox.pdfparser.xref.AbstractXReference
org.apache.pdfbox.pdfparser.xref.NormalXReference
- All Implemented Interfaces:
Comparable<XReferenceEntry>,XReferenceEntry
A class representing a normal reference in a PDF's crossreference stream (
PDFXRefStream).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longprivate final COSObjectKeyprivate final COSBaseprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionNormalXReference(long byteOffset, COSObjectKey key, COSBase object) Prepares a normal reference for the givenCOSObjectin a PDF's crossreference stream (PDFXRefStream). -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the byte offset of theCOSObjectin the PDF file.Returns theCOSObject, that is described by this crossreference stream entry.Returns theCOSObjectKeyof the object, that is described by this crossreference stream entry.longReturns the value for the second column of the crossreference stream entry.longReturns the value for the third column of the crossreference stream entry.booleanReturns true, if the referenced object is an object stream.toString()Returns a string representation of this crossreference stream entry.Methods inherited from class org.apache.pdfbox.pdfparser.xref.AbstractXReference
compareTo, getFirstColumnValue, getType
-
Field Details
-
byteOffset
private final long byteOffset -
key
-
object
-
objectStream
private final boolean objectStream
-
-
Constructor Details
-
NormalXReference
Prepares a normal reference for the givenCOSObjectin a PDF's crossreference stream (PDFXRefStream).- Parameters:
byteOffset- The byte offset of theCOSObjectin the PDF file.key- TheCOSObjectKey, that is represented by this entry.object- TheCOSObject, that is represented by this entry.
-
-
Method Details
-
getByteOffset
public long getByteOffset()Returns the byte offset of theCOSObjectin the PDF file.- Returns:
- The byte offset of the
COSObjectin the PDF file.
-
getReferencedKey
Returns theCOSObjectKeyof the object, that is described by this crossreference stream entry.- Returns:
- The
COSObjectKeyof the object, that is described by this crossreference stream entry.
-
getObject
Returns theCOSObject, that is described by this crossreference stream entry.- Returns:
- The
COSObject, that is described by this crossreference stream entry.
-
isObjectStream
public boolean isObjectStream()Returns true, if the referenced object is an object stream.- Returns:
- True, if the referenced object is an object stream.
-
getSecondColumnValue
public long getSecondColumnValue()Returns the value for the second column of the crossreference stream entry. (This is byte offset of theCOSObjectin the PDF file - for entries of this type.)- Returns:
- The value for the second column of the crossreference stream entry.
-
getThirdColumnValue
public long getThirdColumnValue()Returns the value for the third column of the crossreference stream entry. (This is the generation number of the setCOSObjectKey- for entries of this type.)- Returns:
- The value for the third column of the crossreference stream entry.
-
toString
Returns a string representation of this crossreference stream entry.
-