public class CompareTool.ObjectPath extends Object
You could say that ObjectPath instance consists of two parts: direct path and indirect path. Direct path defines path to the currently comparing objects in relation to base objects. It could be empty, which would mean that currently comparing objects are base objects themselves. Base objects are the two indirect objects from the comparing documents which are in the same position in the pdf trees. Another part, indirect path, defines which indirect objects were met during comparison process to get to the current base objects. Indirect path is needed to avoid infinite loops during comparison.
Modifier and Type | Class and Description |
---|---|
class |
CompareTool.ObjectPath.ArrayPathItem
Direct path item (see CompareTool.ObjectPath , which describes transition to the PdfArray element which is now a currently comparing direct object.
|
class |
CompareTool.ObjectPath.DictPathItem
Direct path item (see CompareTool.ObjectPath , which describes transition to the PdfDictionary entry which value is now a currently comparing direct object.
|
class |
CompareTool.ObjectPath.IndirectPathItem
An item in the indirect path (see CompareTool.ObjectPath .
|
class |
CompareTool.ObjectPath.LocalPathItem
An abstract class for the items in the direct path (see CompareTool.ObjectPath .
|
class |
CompareTool.ObjectPath.OffsetPathItem
Direct path item (see CompareTool.ObjectPath , which describes transition to the specific position in PdfStream .
|
Modifier and Type | Field and Description |
---|---|
protected PdfIndirectReference |
baseCmpObject |
protected PdfIndirectReference |
baseOutObject |
protected Stack<CompareTool.ObjectPath.IndirectPathItem> |
indirects |
protected Stack<CompareTool.ObjectPath.LocalPathItem> |
path |
Modifier | Constructor and Description |
---|---|
|
ObjectPath()
Creates empty ObjectPath.
|
protected |
ObjectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
Creates ObjectPath with corresponding base objects in two documents.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
clone() |
boolean |
equals(Object obj) |
PdfIndirectReference |
getBaseCmpObject() |
PdfIndirectReference |
getBaseOutObject() |
Stack<CompareTool.ObjectPath.IndirectPathItem> |
getIndirectPath()
Gets indirect path which denotes sequence of the indirect references that were passed in comparing process to get to the current base objects.
|
Stack<CompareTool.ObjectPath.LocalPathItem> |
getLocalPath()
Gets local (or direct) path that denotes sequence of the path items from base object to the comparing direct object.
|
int |
hashCode() |
boolean |
isComparing(PdfIndirectReference cmpObject, PdfIndirectReference outObject)
This method is used to define if given objects were already met in the path to the current base objects.
|
void |
pop()
Removes the last path item from the direct path.
|
void |
pushArrayItemToPath(int index)
Adds array item to the direct path.
|
void |
pushDictItemToPath(PdfName key)
Adds dictionary item to the direct path.
|
void |
pushOffsetToPath(int offset)
Adds offset item to the direct path.
|
CompareTool.ObjectPath |
resetDirectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base objects of the current instance of the ObjectPath.
|
String |
toString() |
Node |
toXmlNode(Document document)
Creates an xml node that describes a direct path stored in this ObjectPath instance.
|
protected PdfIndirectReference baseCmpObject
protected PdfIndirectReference baseOutObject
protected Stack<CompareTool.ObjectPath.LocalPathItem> path
protected Stack<CompareTool.ObjectPath.IndirectPathItem> indirects
public ObjectPath()
protected ObjectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
baseCmpObject
- base object in cmp document.
baseOutObject
- base object in out document.
public CompareTool.ObjectPath resetDirectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
Basically, this method creates copy of the current ObjectPath instance, but resets information of the direct paths, and also adds current ObjectPath instance base objects to the indirect references chain that denotes a path to the new base objects.
baseCmpObject
- new base object in cmp document.
baseOutObject
- new base object in out document.
public boolean isComparing(PdfIndirectReference cmpObject, PdfIndirectReference outObject)
cmpObject
- cmp object to check if it was already met in base objects path.
outObject
- out object to check if it was already met in base objects path.
public void pushArrayItemToPath(int index)
CompareTool.ObjectPath.ArrayPathItem
.
index
- index in the array of the direct object to be compared.
public void pushDictItemToPath(PdfName key)
CompareTool.ObjectPath.DictPathItem
.
key
- key in the dictionary to which corresponds direct object to be compared.
public void pushOffsetToPath(int offset)
CompareTool.ObjectPath.OffsetPathItem
.
offset
- offset to the specific byte in the stream that is compared.
public void pop()
public Stack<CompareTool.ObjectPath.LocalPathItem> getLocalPath()
public Stack<CompareTool.ObjectPath.IndirectPathItem> getIndirectPath()
public PdfIndirectReference getBaseCmpObject()
public PdfIndirectReference getBaseOutObject()
public Node toXmlNode(Document document)
document
- xml document, to which this xml node will be added.
public String toString()
Copyright © 1998–2020 iText Group NV. All rights reserved.