Class COSUpdateState
COSUpdateState instance manages update states for a COSUpdateInfo. Such states are used to create
a COSIncrement for the incremental saving of a COSDocument.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate COSDocumentStateTheCOSDocumentStatetheupdateInfois linked to.private booleanThe actual update state ofupdateInfo.private final COSUpdateInfoTheCOSUpdateInfotheCOSUpdateStatedoes manage update states for. -
Constructor Summary
ConstructorsConstructorDescriptionCOSUpdateState(COSUpdateInfo updateInfo) Creates a newCOSUpdateStatefor the givenCOSUpdateInfo. -
Method Summary
Modifier and TypeMethodDescription(package private) voiddereferenceChild(COSBase child) This shallsetOriginDocumentState(COSDocumentState, boolean)for the dereferenced child, initializing itsoriginDocumentState.Returns theoriginDocumentState, that is linked to the managedupdateInfo.(package private) booleanReturnstrue, if the linkedoriginDocumentStateCOSDocumentState.isAcceptingUpdates()and such aCOSDocumentStatehas been linked to thisCOSUpdateState.booleanReturns the actualupdatedstate of the managedupdateInfo.voidsetOriginDocumentState(COSDocumentState originDocumentState) private voidsetOriginDocumentState(COSDocumentState originDocumentState, boolean dereferencing) (package private) COSIncrementUses the managedupdateInfoas the base object of a newCOSIncrement.(package private) voidupdate()Callsupdate(boolean)withtrueas the new update state.
This shall only then have an effect, ifisAcceptingUpdates()returnstrue.(package private) voidupdate(boolean updated) Sets theupdatedstate of the managedupdateInfoto the given state.
This shall only then have an effect, ifisAcceptingUpdates()returnstrue.(package private) voidShall callupdate()for thisCOSUpdateStateand shallsetOriginDocumentState(COSDocumentState)for the given children, initializing theirupdatedstate andoriginDocumentState.(package private) voidShall callupdate()for thisCOSUpdateStateand shallsetOriginDocumentState(COSDocumentState)for the given children, initializing theirupdatedstate andoriginDocumentState.(package private) voidShall callupdate()for thisCOSUpdateStateand shallsetOriginDocumentState(COSDocumentState)for the given child, initializing it´supdatedstate andoriginDocumentState.
-
Field Details
-
updateInfo
TheCOSUpdateInfotheCOSUpdateStatedoes manage update states for. -
originDocumentState
TheCOSDocumentStatetheupdateInfois linked to. -
updated
private boolean updatedThe actual update state ofupdateInfo.true, ifupdateInfohas been updated after the document completed parsing.false, ifupdateInfohas remained unaltered since the document completed parsing.
-
-
Constructor Details
-
COSUpdateState
Creates a newCOSUpdateStatefor the givenCOSUpdateInfo.- Parameters:
updateInfo- TheCOSUpdateInfo, that shall be managed by thisCOSUpdateState.
-
-
Method Details
-
setOriginDocumentState
Links the given
COSDocumentStateto theupdatedstate of the managedupdateInfo.
This shall also initialize
updatedaccordingly and will also set the sameCOSDocumentStatefor all possibly contained substructures.Should
originDocumentStatealready have been set, by a prior call to this method, this shall deny to overwrite it.COSDocumentState.isAcceptingUpdates()shall determine, whether updates toupdateInfoare allowed.As long as no
COSDocumentStateis linked to thisCOSUpdateState, it shall not accept updates.- Parameters:
originDocumentState- TheCOSDocumentStatethat shall be linked to thisCOSUpdateState.- See Also:
-
setOriginDocumentState
Links the given
COSDocumentStateto theupdatedstate of the managedupdateInfo.
This shall also initialize
updatedaccordingly and will also set the sameCOSDocumentStatefor all possibly contained substructures.Should
originDocumentStatealready have been set, by a prior call to this method, this shall deny to overwrite it.COSDocumentState.isAcceptingUpdates()shall determine, whether updates toupdateInfoare allowed.As long as no
COSDocumentStateis linked to thisCOSUpdateState, it shall not accept updates.Additionally to
setOriginDocumentState(COSDocumentState), this shall also deny changingupdated, should the flagdereferencingindicate, that this is caused by dereferencing aCOSObject.- Parameters:
originDocumentState- TheCOSDocumentStatethat shall be linked to thisCOSUpdateState.dereferencing-true, if this update of theCOSDocumentStateis caused by dereferencing aCOSObject.- See Also:
-
getOriginDocumentState
Returns the
originDocumentState, that is linked to the managedupdateInfo.COSDocumentState.isAcceptingUpdates()shall determine, whether updates toupdateInfoare allowed.As long as no
COSDocumentStateis linked to thisCOSUpdateState, it shall not accept updates.- Returns:
- The
COSDocumentStatelinked to thisCOSUpdateState. - See Also:
-
isAcceptingUpdates
boolean isAcceptingUpdates()Returnstrue, if the linkedoriginDocumentStateCOSDocumentState.isAcceptingUpdates()and such aCOSDocumentStatehas been linked to thisCOSUpdateState.- Returns:
true, if the linkedoriginDocumentStateCOSDocumentState.isAcceptingUpdates()and such aCOSDocumentStatehas been linked to thisCOSUpdateState.- See Also:
-
isUpdated
public boolean isUpdated()Returns the actualupdatedstate of the managedupdateInfo.- Returns:
- The actual
updatedstate of the managedupdateInfo - See Also:
-
update
void update()Callsupdate(boolean)withtrueas the new update state.
This shall only then have an effect, ifisAcceptingUpdates()returnstrue.- See Also:
-
update
void update(boolean updated) Sets theupdatedstate of the managedupdateInfoto the given state.
This shall only then have an effect, ifisAcceptingUpdates()returnstrue.- Parameters:
updated- The state to set forupdated.- See Also:
-
update
Shall call
update()for thisCOSUpdateStateand shallsetOriginDocumentState(COSDocumentState)for the given child, initializing it´supdatedstate andoriginDocumentState.This shall have no effect for a child, that is not an instance of
COSUpdateInfo.- Parameters:
child- The child that shall also be updated.- See Also:
-
update
Shall call
update()for thisCOSUpdateStateand shallsetOriginDocumentState(COSDocumentState)for the given children, initializing theirupdatedstate andoriginDocumentState.This shall have no effect for a child, that is not an instance of
COSUpdateInfo.- Parameters:
children- The children that shall also be updated.- See Also:
-
update
Shall call
update()for thisCOSUpdateStateand shallsetOriginDocumentState(COSDocumentState)for the given children, initializing theirupdatedstate andoriginDocumentState.This shall have no effect for a child, that is not an instance of
COSUpdateInfo.- Parameters:
children- The children that shall also be updated.- See Also:
-
dereferenceChild
This shallsetOriginDocumentState(COSDocumentState, boolean)for the dereferenced child, initializing itsoriginDocumentState.This shall have no effect for a child, that is not an instance of
COSUpdateInfoand will never change the child´supdatedstate.- Parameters:
child- The child, that has been dereferenced.- See Also:
-
toIncrement
COSIncrement toIncrement()Uses the managedupdateInfoas the base object of a newCOSIncrement.- Returns:
- A
COSIncrementbased on the managedupdateInfo. - See Also:
-