public class ObjectPath extends Object
You could say that CompareObjectPath 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 | Field and Description |
---|---|
protected Stack<LocalPathItem> |
path |
Constructor and Description |
---|
ObjectPath()
Creates empty ObjectPath.
|
ObjectPath(ObjectPath objectPath)
Creates an ObjectPath object from another ObjectPath object, passed as argument.
|
ObjectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
Creates CompareObjectPath with corresponding base objects in two documents.
|
ObjectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject, Stack<LocalPathItem> path, Stack<IndirectPathItem> indirects) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Method returns true if this ObjectPath instance equals to the passed object.
|
PdfIndirectReference |
getBaseCmpObject()
Method returns current base PdfIndirectReference object in the cmp document.
|
PdfIndirectReference |
getBaseOutObject()
Method returns current base PdfIndirectReference object in the out document.
|
Stack<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<LocalPathItem> |
getLocalPath()
Gets local (or direct) path that denotes sequence of the path items from base object to the comparing direct object.
|
int |
hashCode()
Method returns a hash code of this ObjectPath instance.
|
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.
|
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()
Method returns a string representation of the direct path stored in this ObjectPath instance.
|
Node |
toXmlNode(Document document)
Creates an xml node that describes a direct path stored in this ObjectPath instance.
|
protected Stack<LocalPathItem> path
public ObjectPath()
public ObjectPath(ObjectPath objectPath)
ObjectPath
object from another ObjectPath
object, passed as argument.
objectPath
- an ObjectPath
object to create from.
public ObjectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
baseCmpObject
- base object in cmp document.
baseOutObject
- base object in out document.
public ObjectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject, Stack<LocalPathItem> path, Stack<IndirectPathItem> indirects)
public ObjectPath resetDirectPath(PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
Basically, this method creates copy of the current CompareObjectPath instance, but resets information of the direct paths, and also adds current CompareObjectPath 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)
ArrayPathItem
.
index
- index in the array of the direct object to be compared.
public void pushDictItemToPath(PdfName key)
DictPathItem
.
key
- key in the dictionary to which corresponds direct object to be compared.
public void pushOffsetToPath(int offset)
OffsetPathItem
.
offset
- offset to the specific byte in the stream that is compared.
public void pop()
public Stack<LocalPathItem> getLocalPath()
public Stack<IndirectPathItem> getIndirectPath()
public PdfIndirectReference getBaseCmpObject()
PdfIndirectReference
object in the cmp document.
PdfIndirectReference
object in the cmp document.
public PdfIndirectReference getBaseOutObject()
PdfIndirectReference
object in the out document.
public Node toXmlNode(Document document)
document
- xml document, to which this xml node will be added.
public String toString()
ObjectPath
instance.
public int hashCode()
ObjectPath
instance.
hashCode
in class Object
ObjectPath
instance.
public boolean equals(Object obj)
ObjectPath
instance equals to the passed object.
equals
in class Object
ObjectPath
instance equals to the passed object.
Copyright © 1998–2022 iText Group NV. All rights reserved.