org.apache.pdfbox.cos

## Class COSIncrement

- java.lang.Object
- - org.apache.pdfbox.cos.COSIncrement

All Implemented Interfaces:
  Iterable<COSBase>

    public class COSIncrement
    extends Object
    implements Iterable<COSBase>

A `COSIncrement` starts at a given `COSUpdateInfo` to collect updates, that have been made to a `COSDocument` and therefore should be added to it´s next increment.

Author:
  Christian Appl
See Also:
  `COSUpdateState`, `COSUpdateInfo`

### Constructor Summary

Constructors
Constructor and Description
`COSIncrement(COSUpdateInfo incrementOrigin)` Creates a new `COSIncrement` for the given `COSUpdateInfo`, the increment will use it´s `COSDocumentState` as it´s own origin and shall collect all updates contained in the given `COSUpdateInfo`. Should the given object be `null`, the resulting increment shall be empty.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `contains(COSBase base)` Returns `true` if the given `COSBase` is already known to and has been processed by this `COSIncrement`.
`COSIncrement` `exclude(COSBase... base)` The given `COSBase`s are not fit for inclusion in an increment and shall be added to `excluded`. `null` values shall be ignored.
`Set<COSBase>` `getObjects()` Returns all indirect `COSBase`s, that shall be written to an increment as top level `COSObject`s. Calling this method will cause the increment to be initialized.
`Iterator<COSBase>` `iterator()` Return an iterator for the determined `objects` contained in this `COSIncrement`.

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Constructor Detail

#### COSIncrement

    public COSIncrement(COSUpdateInfo incrementOrigin)

Creates a new `COSIncrement` for the given `COSUpdateInfo`, the increment will use it´s `COSDocumentState` as it´s own origin and shall collect all updates contained in the given `COSUpdateInfo`.
Should the given object be `null`, the resulting increment shall be empty.

Parameters:
  `incrementOrigin` - The `COSUpdateInfo` serving as an update source for this `COSIncrement`.

### Method Detail

#### contains

    public boolean contains(COSBase base)

Returns `true` if the given `COSBase` is already known to and has been processed by this `COSIncrement`.

Parameters:
  `base` - The `COSBase` to check.
Returns:
  `true` if the given `COSBase` is already known to and has been processed by this `COSIncrement`.
See Also:
  `objects`, `processedObjects`

#### exclude

    public COSIncrement exclude(COSBase... base)

The given `COSBase`s are not fit for inclusion in an increment and shall be added to `excluded`.
`null` values shall be ignored.

Parameters:
  `base` - The `COSBase`s to add to `excluded`.
Returns:
  The `COSIncrement` itself, to allow method chaining.
See Also:
  `excluded`

#### getObjects

    public Set<COSBase> getObjects()

Returns all indirect `COSBase`s, that shall be written to an increment as top level `COSObject`s.
Calling this method will cause the increment to be initialized.

Returns:
  All indirect `COSBase`s, that shall be written to an increment as top level `COSObject`s.
See Also:
  `objects`

#### iterator

    public Iterator<COSBase> iterator()

Return an iterator for the determined `objects` contained in this `COSIncrement`.

Specified by:
  `iterator` in interface `Iterable<COSBase>`
Returns:
  An iterator for the determined `objects` contained in this `COSIncrement`.