PageTreeNode (JHOVE Documentation)
Date: 2013-09-08

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.harvard.hul.ois.jhove.module.pdf
Class PageTreeNode

    java.lang.Object
      edu.harvard.hul.ois.jhove.module.pdf.DocNode
          edu.harvard.hul.ois.jhove.module.pdf.PageTreeNode

    public class PageTreeNode

extends DocNode

Class encapsulating a PDF page tree node. The page tree is built such that callers can walk through it by calling startWalk and then calling nextDocNode (for all nodes) or nextPageObject (for pages only) repeatedly.

Field Summary

Fields inherited from class edu.harvard.hul.ois.jhove.module.pdf.DocNode
`_dict, _module, _pageObjectFlag, _parent, _walkFinished`

Constructor Summary
`PageTreeNode(PdfModule module, PageTreeNode parent, PdfDictionary dict)` Superclass constructor.

Method Summary
`void` | `buildSubtree(boolean toplevel, int recGuard)` Builds the subtree of descendants of this node, using the Kids entry in the dictionary.
`void` | `buildSubtree(boolean toplevel, int recGuard, int objNumber, int genNumber)` Builds the subtree of descendants of this node, using the Kids entry in the dictionary.
`DocNode` | `nextDocNode()` Get the next DocNode which is under this node.
`PageObject` | `nextPageObject()` Get the next PageObject which is under this node.
`void` | `startWalk()` Initialize an iterator through the descendants of this node.

Methods inherited from class edu.harvard.hul.ois.jhove.module.pdf.DocNode
`get, getDict, getFontResources, getMediaBox, getParent, getResources, isPageObject`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PageTreeNode

    public PageTreeNode(PdfModule module,
                        PageTreeNode parent,
                        PdfDictionary dict)

  Superclass constructor.

  Parameters:
    `module` - The PDFModule under which we're operating
    `parent` - The parent node in the document tree; may be null only for the root node
    `dict` - The dictionary object on which this node is based

Method Detail

### buildSubtree

    public void buildSubtree(boolean toplevel,
                             int recGuard)
                      throws PdfException

  Builds the subtree of descendants of this node, using the Kids entry in the dictionary.

  Throws:
    `PdfException`

### buildSubtree

    public void buildSubtree(boolean toplevel,
                             int recGuard,
                             int objNumber,
                             int genNumber)
                      throws PdfException

  Builds the subtree of descendants of this node, using the Kids entry in the dictionary.

  Throws:
    `PdfException`

### startWalk

    public void startWalk()

  Initialize an iterator through the descendants of this node.

  Specified by:
    `startWalk` in class `DocNode`

### nextPageObject

    public PageObject nextPageObject()
                              throws PdfMalformedException

  Get the next PageObject which is under this node. This function is designed such that calling startWalk() and then repeatedly calling nextPageObject() will return all the PageObjects in the tree under this node, and finally will return null when there are no more.

  Specified by:
    `nextPageObject` in class `DocNode`
  Throws:
    `PdfMalformedException`

### nextDocNode

    public DocNode nextDocNode()
                        throws PdfMalformedException

  Get the next DocNode which is under this node. This function is designed such that calling startWalk() and then repeatedly calling nextPageObject() will return first this node, then all the DocNodes in the tree under this node. It finally will return null when there are no more.

  Specified by:
    `nextDocNode` in class `DocNode`
  Throws:
    `PdfMalformedException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD