public class PdfIndirectReference extends PdfObject implements Comparable<PdfIndirectReference>
Modifier and Type | Field and Description |
---|---|
protected int |
genNr
Object generation.
|
protected int |
objectStreamNumber
Indirect reference number of object stream containing refersTo object.
|
protected int |
objNr
Object number.
|
protected long |
offsetOrIndex
Offset in a document of the refersTo object.
|
protected PdfDocument |
pdfDocument
PdfDocument object belongs to.
|
protected PdfObject |
refersTo
PdfObject that current PdfIndirectReference instance refers to.
|
ARRAY, BOOLEAN, DICTIONARY, FLUSHED, FORBID_RELEASE, FREE, INDIRECT_REFERENCE, indirectReference, LITERAL, MODIFIED, MUST_BE_FLUSHED, MUST_BE_INDIRECT, NAME, NULL, NUMBER, ORIGINAL_OBJECT_STREAM, READ_ONLY, READING, STREAM, STRING, UNENCRYPTED
Modifier | Constructor and Description |
---|---|
protected |
PdfIndirectReference(PdfDocument doc, int objNr) |
protected |
PdfIndirectReference(PdfDocument doc, int objNr, int genNr) |
protected |
PdfIndirectReference(PdfDocument doc, int objNr, int genNr, long offset) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PdfIndirectReference o) |
protected void |
copyContent(PdfObject from, PdfDocument document)
Copies object content from object 'from'.
|
boolean |
equals(Object o) |
PdfDocument |
getDocument() |
int |
getGenNumber() |
int |
getIndex()
Gets refersTo object index in the object stream.
|
int |
getObjNumber() |
int |
getObjStreamNumber() |
long |
getOffset()
Gets refersTo object offset in a document.
|
protected PdfReader |
getReader()
Gets a PdfReader associated with the document object belongs to.
|
PdfObject |
getRefersTo() |
PdfObject |
getRefersTo(boolean recursively)
Gets direct object and try to resolve indirects chain.
|
byte |
getType()
Gets object type.
|
protected PdfWriter |
getWriter()
Gets a PdfWriter associated with the document object belongs to.
|
int |
hashCode() |
protected boolean |
isFree() |
protected PdfObject |
newInstance()
Creates new instance of object.
|
void |
setFree()
Releases indirect reference from the document.
|
protected void |
setRefersTo(PdfObject refersTo) |
protected PdfIndirectReference |
setState(short state)
Sets special states of current object.
|
String |
toString() |
checkState, clearState, clone, copyTo, copyTo, flush, flush, getIndirectReference, isArray, isBoolean, isDictionary, isFlushed, isIndirect, isIndirectReference, isLiteral, isModified, isName, isNull, isNumber, isStream, isString, makeIndirect, makeIndirect, release, setIndirectReference, setModified
protected final int objNr
protected int genNr
protected PdfObject refersTo
protected int objectStreamNumber
protected long offsetOrIndex
refersTo
object. If the object placed into object stream then it is an object index inside object stream.
protected PdfDocument pdfDocument
protected PdfIndirectReference(PdfDocument doc, int objNr)
protected PdfIndirectReference(PdfDocument doc, int objNr, int genNr)
protected PdfIndirectReference(PdfDocument doc, int objNr, int genNr, long offset)
public int getObjNumber()
public int getGenNumber()
public PdfObject getRefersTo()
public PdfObject getRefersTo(boolean recursively)
Note: If chain of references has length of more than 32, this method return 31st reference in chain.
protected void setRefersTo(PdfObject refersTo)
public int getObjStreamNumber()
public long getOffset()
public int getIndex()
public int compareTo(PdfIndirectReference o)
compareTo
in interface Comparable<PdfIndirectReference>
public byte getType()
PdfObject
public PdfDocument getDocument()
public void setFree()
Note: Be careful when using this method. Do not use this method for wrapper objects, it can be cause of errors. Free indirect reference could be reused for a new indirect object.
protected PdfWriter getWriter()
protected PdfReader getReader()
protected boolean isFree()
protected PdfObject newInstance()
PdfObject
newInstance
in class PdfObject
protected void copyContent(PdfObject from, PdfDocument document)
PdfObject
copyContent
in class PdfObject
from
- object to copy content from.
document
- document to copy object to.
protected PdfIndirectReference setState(short state)
Copyright © 1998–2017 iText Group NV. All rights reserved.