List<PdfDirectObject> operands = operation.getOperands();
if(operands != null)
{
for(int index = 0, length = operands.size(); index < length; index++)
{
PdfDirectObject operand = operands.get(index);
if(operand instanceof PdfArray)
{
PdfArray operandElements = (PdfArray)operand;
int operandElementIndex = -1;
for(PdfDirectObject operandElement : operandElements)
{
model.addRow(
new Object[]
{
"(operand " + index + "." + (++operandElementIndex) + ")",
operandElement.toString()
}
);
}
}
else if(operand instanceof PdfDictionary)
{
PdfDictionary operandEntries = (PdfDictionary)operand;
int operandEntryIndex = -1;
for(Map.Entry<PdfName,PdfDirectObject> operandEntry : operandEntries.entrySet())
{
model.addRow(
new Object[]
{
"(operand " + index + "." + (++operandEntryIndex) + ") " + operandEntry.getKey().toString(),
operandEntry.getValue().toString()
}
);
}
}
else
{
model.addRow(
new Object[]
{
"(operand " + index + ")",
operand.toString()
}
);
}
}
}