FObj.FObjIterator (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.fo

## Class FObj.FObjIterator

- java.lang.Object
- - org.apache.fop.fo.FObj.FObjIterator

- All Implemented Interfaces:
    Iterator<FONode>, ListIterator<FONode>, FONode.FONodeIterator
  Enclosing class:
    FObj

      public static class FObj.FObjIterator
      extends Object
      implements FONode.FONodeIterator

  Basic `FONode.FONodeIterator` implementation

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(FONode newNode)` Add the given `newNode` at the current position.
    `FONode` | `first()` Returns the first node in the list, and decreases the index, so that a subsequent call to `hasPrevious()` will return `false`
    `boolean` | `hasNext()`
    `boolean` | `hasPrevious()`
    `FONode` | `last()` Returns the last node in the list, and advances the current position, so that a subsequent call to `hasNext()` will return `false`
    `FONode` | `next()`
    `int` | `nextIndex()`
    `FObj` | `parent()` Returns the parent node for this iterator's list of child nodes
    `FONode` | `previous()`
    `int` | `previousIndex()`
    `void` | `remove()` Removes the node at the current position.
    `void` | `set(FONode newNode)` Replace the node at the current index with the given `newNode`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Method Detail

    - #### parent

          public FObj parent()

      Returns the parent node for this iterator's list of child nodes
      Specified by:
        `parent` in interface `FONode.FONodeIterator`
      Returns:
        the parent node

    - #### next

          public FONode next()

      Specified by:
        `next` in interface `Iterator<FONode>`
      Specified by:
        `next` in interface `ListIterator<FONode>`
      Specified by:
        `next` in interface `FONode.FONodeIterator`
      Returns:
        the next node

    - #### previous

          public FONode previous()

      Specified by:
        `previous` in interface `ListIterator<FONode>`
      Specified by:
        `previous` in interface `FONode.FONodeIterator`
      Returns:
        the previous node

    - #### set

          public void set(FONode newNode)

      Replace the node at the current index with the given `newNode`.
      Specified by:
        `set` in interface `ListIterator<FONode>`
      Specified by:
        `set` in interface `FONode.FONodeIterator`
      Parameters:
        `newNode` - the new node

    - #### add

          public void add(FONode newNode)

      Add the given `newNode` at the current position.
      Specified by:
        `add` in interface `ListIterator<FONode>`
      Specified by:
        `add` in interface `FONode.FONodeIterator`
      Parameters:
        `newNode` - the new node

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<FONode>`
      Specified by:
        `hasNext` in interface `ListIterator<FONode>`
      Specified by:
        `hasNext` in interface `FONode.FONodeIterator`
      Returns:
        `true` if there is a next node, `false` otherwise

    - #### hasPrevious

          public boolean hasPrevious()

      Specified by:
        `hasPrevious` in interface `ListIterator<FONode>`
      Specified by:
        `hasPrevious` in interface `FONode.FONodeIterator`
      Returns:
        `true` if there is a previous node, `false` otherwise

    - #### nextIndex

          public int nextIndex()

      Specified by:
        `nextIndex` in interface `ListIterator<FONode>`
      Specified by:
        `nextIndex` in interface `FONode.FONodeIterator`
      Returns:
        the current index

    - #### previousIndex

          public int previousIndex()

      Specified by:
        `previousIndex` in interface `ListIterator<FONode>`
      Specified by:
        `previousIndex` in interface `FONode.FONodeIterator`
      Returns:
        the previous index

    - #### remove

          public void remove()

      Removes the node at the current position.
      Specified by:
        `remove` in interface `Iterator<FONode>`
      Specified by:
        `remove` in interface `ListIterator<FONode>`
      Specified by:
        `remove` in interface `FONode.FONodeIterator`

    - #### last

          public FONode last()

      Returns the last node in the list, and advances the current position, so that a subsequent call to `hasNext()` will return `false`
      Specified by:
        `last` in interface `FONode.FONodeIterator`
      Returns:
        the last node in the list

    - #### first

          public FONode first()

      Returns the first node in the list, and decreases the index, so that a subsequent call to `hasPrevious()` will return `false`
      Specified by:
        `first` in interface `FONode.FONodeIterator`
      Returns:
        the first node in the list

Copyright © 2025 Apache Software Foundation. All rights reserved.