com.sun.pdfview
Class PDFXrefEntry

java.lang.Object
  extended by com.sun.pdfview.PDFXrefEntry

public class PDFXrefEntry
extends java.lang.Object

An entry found in a PDFFile's xref table or xref streams, identifying the position of an object within the structure of a PDF, and the latest generation number for a given object. May also indicate that a given object number has been freed, and that references to objects with that object number should be treated as references to the null object.


Method Summary
 int getGeneration()
           
 PDFObject getObject()
           
 int[] getObjectIndexOffsets()
           
 int getOffset()
           
 PDFXref getStream()
           
 com.sun.pdfview.PDFXrefEntry.Type getType()
           
 boolean resolves(PDFXref ref)
           
 void setObject(PDFObject obj)
          Cache a reference to the target object of this entry
 void setObjectIndexOffsets(int[] objectIndexOffsets)
          For entries for object streams, set the offsets of each object in the stream, arranged by index number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resolves

public boolean resolves(PDFXref ref)

getOffset

public int getOffset()
Returns:
the offset into the file for in-body references, or the index of the object within the given stream for in-stream references.

getStream

public PDFXref getStream()
Returns:
the stream of the object for in-stream references; null for other entry types

getType

public com.sun.pdfview.PDFXrefEntry.Type getType()
Returns:
the type of entry

getGeneration

public int getGeneration()
Returns:
the generation number of the object this entry is for

getObject

public PDFObject getObject()
Returns:
any cached reference to the object that his entry refers to; null if this entry has yet to be looked at, or its target has been garbage collected

setObject

public void setObject(PDFObject obj)
Cache a reference to the target object of this entry

Parameters:
obj - the object to cache

getObjectIndexOffsets

public int[] getObjectIndexOffsets()
Returns:
for entries for object streams, the offsets of each object in the stream, arranged by index number

setObjectIndexOffsets

public void setObjectIndexOffsets(int[] objectIndexOffsets)
For entries for object streams, set the offsets of each object in the stream, arranged by index number

Parameters:
objectIndexOffsets - the object index offsets