org.apache.pdfbox.cos

## Class COSUpdateState

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

    public class COSUpdateState
    extends Object

A `COSUpdateState` instance manages update states for a `COSUpdateInfo`. Such states are used to create a `COSIncrement` for the incremental saving of a `COSDocument`.

Author:
  Christian Appl
See Also:
  `COSDocumentState`, `COSUpdateInfo`, `COSIncrement`

### Constructor Summary

Constructors
Constructor and Description
`COSUpdateState(COSUpdateInfo updateInfo)` Creates a new `COSUpdateState` for the given `COSUpdateInfo`.

### Method Summary

All Methods Instance Methods Concrete Methods
`COSDocumentState` `getOriginDocumentState()` Returns the `originDocumentState`, that is linked to the managed `updateInfo`.
`boolean` `isUpdated()` Returns the actual `updated` state of the managed `updateInfo`.
`void` `setOriginDocumentState(COSDocumentState originDocumentState)` Links the given `COSDocumentState` to the `updated` state of the managed `updateInfo`.

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

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

### Constructor Detail

#### COSUpdateState

    public COSUpdateState(COSUpdateInfo updateInfo)

Creates a new `COSUpdateState` for the given `COSUpdateInfo`.

Parameters:
  `updateInfo` - The `COSUpdateInfo`, that shall be managed by this `COSUpdateState`.

### Method Detail

#### setOriginDocumentState

    public void setOriginDocumentState(COSDocumentState originDocumentState)

Links the given `COSDocumentState` to the `updated` state of the managed `updateInfo`.

This shall also initialize `updated` accordingly and will also set the same `COSDocumentState` for all possibly contained substructures.

Should `originDocumentState` already have been set, by a prior call to this method, this shall deny to overwrite it.

`COSDocumentState.isAcceptingUpdates()` shall determine, whether updates to `updateInfo` are allowed.

As long as no `COSDocumentState` is linked to this `COSUpdateState`, it shall not accept updates.

Parameters:
  `originDocumentState` - The `COSDocumentState` that shall be linked to this `COSUpdateState`.
See Also:
  `originDocumentState`, `updated`

#### getOriginDocumentState

    public COSDocumentState getOriginDocumentState()

Returns the `originDocumentState`, that is linked to the managed `updateInfo`.

`COSDocumentState.isAcceptingUpdates()` shall determine, whether updates to `updateInfo` are allowed.

As long as no `COSDocumentState` is linked to this `COSUpdateState`, it shall not accept updates.

Returns:
  The `COSDocumentState` linked to this `COSUpdateState`.
See Also:
  `setOriginDocumentState(COSDocumentState)`

#### isUpdated

    public boolean isUpdated()

Returns the actual `updated` state of the managed `updateInfo`.

Returns:
  The actual `updated` state of the managed `updateInfo`
See Also:
  `updated`