Package org.apache.pdfbox.cos
Class COSIncrement
java.lang.Object
org.apache.pdfbox.cos.COSIncrement
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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final COSUpdateInfoContains theCOSUpdateInfothat thisCOSIncrementcreates an increment for.private booleanWhether thisCOSIncrementhas already been determined, or must still be evaluated.Contains theCOSBases, that shall be added to the increment at top level.Contains allCOSObjects, that have already been processed by thisCOSIncrementand shall not be processed again. -
Constructor Summary
ConstructorsConstructorDescriptionCOSIncrement(COSUpdateInfo incrementOrigin) Creates a newCOSIncrementfor the givenCOSUpdateInfo, the increment will use it´sCOSDocumentStateas it´s own origin and shall collect all updates contained in the givenCOSUpdateInfo.
Should the given object benull, the resulting increment shall be empty. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidThe given object and actual {COSBase}s shall be part of the increment and must be added toobjects, if possible.
nullvalues shall be skipped.private voidaddProcessedObject(COSObject base) The givenCOSObjecthas been processed, or is being processed.private booleanCollect all updates made to the givenCOSArrayand it's contained structures.private booleanCollect all updates made to the givenCOSBaseand it's contained structures.
This shall forward allCOSUpdateInfoobjects to the proper specialized collection methods.private booleancollect(COSDictionary dictionary) Collect all updates made to the givenCOSDictionaryand it's contained structures.private booleanCollect all updates made to the givenCOSObjectand it's contained structures.booleanprivate booleanisExcluded(COSBase base) iterator()Return an iterator for the determinedobjectscontained in thisCOSIncrement.private voidupdateDifferentOrigin(COSUpdateState updateState) Check whether the givenCOSUpdateState´sCOSDocumentStatediffers from theCOSIncrement´s knownincrementOrigin.
Should that be the case, theCOSUpdateStateoriginates from anotherCOSDocumentand must be added to theCOSIncrement, hence callCOSUpdateState.update().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
objects
Contains theCOSBases, that shall be added to the increment at top level. -
excluded
-
processedObjects
Contains allCOSObjects, that have already been processed by thisCOSIncrementand shall not be processed again. -
incrementOrigin
Contains theCOSUpdateInfothat thisCOSIncrementcreates an increment for. -
initialized
private boolean initializedWhether thisCOSIncrementhas already been determined, or must still be evaluated.
-
-
Constructor Details
-
COSIncrement
Creates a newCOSIncrementfor the givenCOSUpdateInfo, the increment will use it´sCOSDocumentStateas it´s own origin and shall collect all updates contained in the givenCOSUpdateInfo.
Should the given object benull, the resulting increment shall be empty.- Parameters:
incrementOrigin- TheCOSUpdateInfoserving as an update source for thisCOSIncrement.
-
-
Method Details
-
collect
Collect all updates made to the givenCOSBaseand it's contained structures.
This shall forward allCOSUpdateInfoobjects to the proper specialized collection methods. -
collect
Collect all updates made to the givenCOSDictionaryand it's contained structures.- Parameters:
dictionary- TheCOSDictionaryupdates shall be collected for.- Returns:
- Returns
true, if theCOSDictionaryrepresents a direct child structure, that would require it´s parent to be updated instead.
-
collect
Collect all updates made to the givenCOSArrayand it's contained structures.- Parameters:
array- TheCOSDictionaryupdates shall be collected for.- Returns:
- Returns
true, if theCOSArray´s elements changed. ACOSArrayshall always be treated as a direct structure, that would require it´s parent to be updated instead.
-
collect
Collect all updates made to the givenCOSObjectand it's contained structures. -
contains
- Parameters:
base- TheCOSBaseto check.- Returns:
true, if the givenCOSBaseis already known to and has been processed by thisCOSIncrement.- See Also:
-
updateDifferentOrigin
Check whether the givenCOSUpdateState´sCOSDocumentStatediffers from theCOSIncrement´s knownincrementOrigin.
Should that be the case, theCOSUpdateStateoriginates from anotherCOSDocumentand must be added to theCOSIncrement, hence callCOSUpdateState.update().- Parameters:
updateState- TheCOSUpdateStatethat shall be updated, if it's originating from anotherCOSDocument.- See Also:
-
add
The given object and actual {COSBase}s shall be part of the increment and must be added toobjects, if possible.
nullvalues shall be skipped. -
addProcessedObject
The givenCOSObjecthas been processed, or is being processed. It shall be added toprocessedObjectsto skip it, should it be encountered again.
nullvalues shall be ignored.- Parameters:
base- TheCOSObjectto add toprocessedObjects.- See Also:
-
exclude
The givenCOSBases are not fit for inclusion in an increment and shall be added toexcluded.
nullvalues shall be ignored.- Parameters:
base- TheCOSBases to add toexcluded.- Returns:
- The
COSIncrementitself, to allow method chaining. - See Also:
-
isExcluded
-
getObjects
-
iterator
Return an iterator for the determinedobjectscontained in thisCOSIncrement.- Specified by:
iteratorin interfaceIterable<COSBase>- Returns:
- An iterator for the determined
objectscontained in thisCOSIncrement.
-