Class ObjectStreamXReference

java.lang.Object
org.apache.pdfbox.pdfparser.xref.AbstractXReference
org.apache.pdfbox.pdfparser.xref.ObjectStreamXReference
All Implemented Interfaces:
Comparable<XReferenceEntry>, XReferenceEntry

public class ObjectStreamXReference extends AbstractXReference
A class representing a reference to an object stream entry in a PDF's crossreference stream (PDFXRefStream).
  • Field Details

    • objectStreamIndex

      private final int objectStreamIndex
    • key

      private final COSObjectKey key
    • object

      private final COSBase object
    • parentKey

      private final COSObjectKey parentKey
  • Constructor Details

    • ObjectStreamXReference

      public ObjectStreamXReference(int objectStreamIndex, COSObjectKey key, COSBase object, COSObjectKey parentKey)
      Prepares a object stream entry reference for the given COSObject in a PDF's crossreference stream (PDFXRefStream).
      Parameters:
      objectStreamIndex - The index of the COSObject in the containing object stream.
      key - The COSObjectKey, that is represented by this entry.
      object - The COSObject, that is represented by this entry.
      parentKey - The COSObjectKey of the object stream, that is containing the object.
  • Method Details

    • getObjectStreamIndex

      public int getObjectStreamIndex()
      Returns the index of the COSObject in it's containing object stream.
      Returns:
      The index of the COSObject in it's containing object stream.
    • getReferencedKey

      public COSObjectKey getReferencedKey()
      Returns the COSObjectKey of the object, that is described by this crossreference stream entry.
      Returns:
      The COSObjectKey of the object, that is described by this crossreference stream entry.
    • getObject

      public COSBase getObject()
      Returns the COSObject, that is described by this crossreference stream entry.
      Returns:
      The COSObject, that is described by this crossreference stream entry.
    • getParentKey

      public COSObjectKey getParentKey()
      Returns the COSObjectKey of the object stream, that is containing the object.
      Returns:
      The COSObjectKey of the object stream, that is containing the object.
    • getSecondColumnValue

      public long getSecondColumnValue()
      Returns the value for the second column of the crossreference stream entry. (This is object number from the COSObjectKey of the object stream, that is containing the object represented by this entry - 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 index of the COSObject in the containing object stream - for entries of this type.)
      Returns:
      The value for the third column of the crossreference stream entry.
    • toString

      public String toString()
      Returns a string representation of this crossreference stream entry.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this crossreference stream entry.