Top Description Fields Constructors Methods
org.apache.pdfbox.cos

public Class COSUpdateState

extends Object
Class Inheritance

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

Field Summary

Modifier and TypeField and Description
private COSDocumentState
private boolean
updated

The actual update state of updateInfo.

private final COSUpdateInfo
updateInfo

The COSUpdateInfo the COSUpdateState does manage update states for.

Constructor Summary

AccessConstructor and Description
public
COSUpdateState(COSUpdateInfo
The COSUpdateInfo, that shall be managed by this COSUpdateState.
updateInfo
)

Creates a new COSUpdateState for the given COSUpdateInfo.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
dereferenceChild(COSBase
The child, that has been dereferenced.
child
)

This shall setOriginDocumentState(COSDocumentState, boolean) for the dereferenced child, initializing its originDocumentState.

public COSDocumentState

Returns:

The COSDocumentState linked to this COSUpdateState.
getOriginDocumentState
()

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

pack-priv boolean

Returns:

true, if the linked originDocumentState COSDocumentState#isAcceptingUpdates() and such a COSDocumentState has been linked to this COSUpdateState.
isAcceptingUpdates
()

Returns true, if the linked originDocumentState COSDocumentState#isAcceptingUpdates() and such a COSDocumentState has been linked to this COSUpdateState.

public boolean

Returns:

The actual updated state of the managed updateInfo
isUpdated
()

Returns the actual updated state of the managed updateInfo.

public void
setOriginDocumentState(COSDocumentState
The COSDocumentState that shall be linked to this COSUpdateState.
originDocumentState
)

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

private void
setOriginDocumentState(COSDocumentState
The COSDocumentState that shall be linked to this COSUpdateState.
originDocumentState
,
boolean
true, if this update of the COSDocumentState is caused by dereferencing a COSObject.
dereferencing
)

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

pack-priv COSIncrement

Returns:

A COSIncrement based on the managed updateInfo.
toIncrement
()

Uses the managed updateInfo as the base object of a new COSIncrement.

pack-priv void
update()

Calls update(boolean) with true as the new update state.

pack-priv void
update(boolean
The state to set for updated.
updated
)

Sets the updated state of the managed updateInfo to the given state.

pack-priv void
update(COSBase
The child that shall also be updated.
child
)

Shall call update() for this COSUpdateState and shall setOriginDocumentState(COSDocumentState) for the given child, initializing it´s updated state and originDocumentState.

pack-priv void
update(COSArray
The children that shall also be updated.
children
)

Shall call update() for this COSUpdateState and shall setOriginDocumentState(COSDocumentState) for the given children, initializing their updated state and originDocumentState.

pack-priv void
update(Iterable<COSBase>
The children that shall also be updated.
children
)

Shall call update() for this COSUpdateState and shall setOriginDocumentState(COSDocumentState) for the given children, initializing their updated state and originDocumentState.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

originDocumentStateback to summary
private COSDocumentState originDocumentState

The COSDocumentState the updateInfo is linked to.

updatedback to summary
private boolean updated

The actual update state of updateInfo.

  • true, if updateInfo has been updated after the document completed parsing.
  • false, if updateInfo has remained unaltered since the document completed parsing.
updateInfoback to summary
private final COSUpdateInfo updateInfo

The COSUpdateInfo the COSUpdateState does manage update states for.

Constructor Detail

COSUpdateStateback to summary
public COSUpdateState(COSUpdateInfo updateInfo)

Creates a new COSUpdateState for the given COSUpdateInfo.

Parameters
updateInfo:COSUpdateInfo

The COSUpdateInfo, that shall be managed by this COSUpdateState.

Method Detail

dereferenceChildback to summary
pack-priv void dereferenceChild(COSBase child)

This shall setOriginDocumentState(COSDocumentState, boolean) for the dereferenced child, initializing its originDocumentState.

This shall have no effect for a child, that is not an instance of COSUpdateInfo and will never change the child´s updated state.

Parameters
child:COSBase

The child, that has been dereferenced.

See Also
setOriginDocumentState(COSDocumentState, boolean)
getOriginDocumentStateback to summary
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:COSDocumentState

The COSDocumentState linked to this COSUpdateState.

See Also
setOriginDocumentState(COSDocumentState)
isAcceptingUpdatesback to summary
pack-priv boolean isAcceptingUpdates()

Returns true, if the linked originDocumentState COSDocumentState#isAcceptingUpdates() and such a COSDocumentState has been linked to this COSUpdateState.

Returns:boolean

true, if the linked originDocumentState COSDocumentState#isAcceptingUpdates() and such a COSDocumentState has been linked to this COSUpdateState.

See Also
originDocumentState, COSDocumentState#isAcceptingUpdates()
isUpdatedback to summary
public boolean isUpdated()

Returns the actual updated state of the managed updateInfo.

Returns:boolean

The actual updated state of the managed updateInfo

See Also
updated
setOriginDocumentStateback to summary
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:COSDocumentState

The COSDocumentState that shall be linked to this COSUpdateState.

See Also
originDocumentState, updated
setOriginDocumentStateback to summary
private void setOriginDocumentState(COSDocumentState originDocumentState, boolean dereferencing)

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.

Additionally to setOriginDocumentState(COSDocumentState), this shall also deny changing updated, should the flag dereferencing indicate, that this is caused by dereferencing a COSObject.

Parameters
originDocumentState:COSDocumentState

The COSDocumentState that shall be linked to this COSUpdateState.

dereferencing:boolean

true, if this update of the COSDocumentState is caused by dereferencing a COSObject.

See Also
originDocumentState, updated
toIncrementback to summary
pack-priv COSIncrement toIncrement()

Uses the managed updateInfo as the base object of a new COSIncrement.

Returns:COSIncrement

A COSIncrement based on the managed updateInfo.

See Also
COSUpdateInfo, COSIncrement
updateback to summary
pack-priv void update()

Calls update(boolean) with true as the new update state.
This shall only then have an effect, if isAcceptingUpdates() returns true.

See Also
update(boolean), updated, isAcceptingUpdates()
updateback to summary
pack-priv void update(boolean updated)

Sets the updated state of the managed updateInfo to the given state.
This shall only then have an effect, if isAcceptingUpdates() returns true.

Parameters
updated:boolean

The state to set for updated.

See Also
update(boolean), updated, isAcceptingUpdates()
updateback to summary
pack-priv void update(COSBase child)

Shall call update() for this COSUpdateState and shall setOriginDocumentState(COSDocumentState) for the given child, initializing it´s updated state and originDocumentState.

This shall have no effect for a child, that is not an instance of COSUpdateInfo.

Parameters
child:COSBase

The child that shall also be updated.

See Also
update(), setOriginDocumentState(COSDocumentState)
updateback to summary
pack-priv void update(COSArray children)

Shall call update() for this COSUpdateState and shall setOriginDocumentState(COSDocumentState) for the given children, initializing their updated state and originDocumentState.

This shall have no effect for a child, that is not an instance of COSUpdateInfo.

Parameters
children:COSArray

The children that shall also be updated.

See Also
update(), setOriginDocumentState(COSDocumentState)
updateback to summary
pack-priv void update(Iterable<COSBase> children)

Shall call update() for this COSUpdateState and shall setOriginDocumentState(COSDocumentState) for the given children, initializing their updated state and originDocumentState.

This shall have no effect for a child, that is not an instance of COSUpdateInfo.

Parameters
children:Iterable<COSBase>

The children that shall also be updated.

See Also
update(), setOriginDocumentState(COSDocumentState)