com.etymon.pjx.util
Class PdfFieldTree.FieldTreeIterator

java.lang.Object
  extended by com.etymon.pjx.util.PdfFieldTree.FieldTreeIterator
All Implemented Interfaces:
PdfFieldTreeIterator
Enclosing class:
PdfFieldTree

protected class PdfFieldTree.FieldTreeIterator
extends java.lang.Object
implements PdfFieldTreeIterator

An iterator over the tree of field dictionaries in a PDF document.


Field Summary
protected  PdfFieldTree _ft
          The field tree associated with this iterator.
protected  PdfManager _m
          The manager associated with this iterator.
 
Constructor Summary
PdfFieldTree.FieldTreeIterator(PdfFieldTree ft, PdfManager m)
          Constructs an iterator over a field tree.
 
Method Summary
protected  void cleanUp()
          Removes any empty lists from the top of the stack.
protected  PdfReference descendTree()
          Descends the left-edge of the tree until reaching a terminal node and returns its reference.
 boolean hasNext()
          Returns true if any more field objects remain.
protected  java.util.List newList(java.util.List list)
           
 PdfReference next()
          Returns an indirect reference to the next field object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_m

protected PdfManager _m
The manager associated with this iterator.


_ft

protected PdfFieldTree _ft
The field tree associated with this iterator.

Constructor Detail

PdfFieldTree.FieldTreeIterator

public PdfFieldTree.FieldTreeIterator(PdfFieldTree ft,
                                      PdfManager m)
                               throws java.io.IOException,
                                      PdfFormatException
Constructs an iterator over a field tree.

Parameters:
ft - the field tree to iterate over.
m - the associated document manager.
Throws:
java.io.IOException
PdfFormatException
Method Detail

newList

protected java.util.List newList(java.util.List list)

descendTree

protected PdfReference descendTree()
                            throws java.io.IOException,
                                   PdfFormatException
Descends the left-edge of the tree until reaching a terminal node and returns its reference. As the tree is descended, this method pushes field lists onto the stack.

Returns:
an indirect reference to the terminal node
Throws:
java.io.IOException
PdfFormatException

cleanUp

protected void cleanUp()
Removes any empty lists from the top of the stack.


hasNext

public boolean hasNext()
                throws PdfFormatException
Description copied from interface: PdfFieldTreeIterator
Returns true if any more field objects remain.

Specified by:
hasNext in interface PdfFieldTreeIterator
Returns:
true if more field objects remain.
Throws:
PdfFormatException

next

public PdfReference next()
                  throws java.util.NoSuchElementException,
                         java.io.IOException,
                         PdfFormatException
Description copied from interface: PdfFieldTreeIterator
Returns an indirect reference to the next field object.

Specified by:
next in interface PdfFieldTreeIterator
Returns:
the indirect reference.
Throws:
java.io.IOException
PdfFormatException
java.util.NoSuchElementException