Package com.inet.pdfc.generator.model
Class DiffGroup
- java.lang.Object
-
- com.inet.pdfc.generator.model.DiffGroup
-
- All Implemented Interfaces:
java.io.Serializable
@JsonData public abstract class DiffGroup extends java.lang.Object implements java.io.SerializableADiffGroupdescribes a set of subsequentModifications in a document. It is characterized by the fact the the elements in front of and after theDiffGroupare equal. Furthermore there are no equal elements inside the range of aDiffGroup.
Any group has a type which indicates the severity of theModifications in this group. For a detailed description refer to theDiffGroup.GroupTypeenumeration.
NOTE: SomeDiffGrouphave no modifications at all. These groups always have the typeDiffGroup.GroupType.Syncand are a hint to faster sync back to equal elements after a modification.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDiffGroup.GroupTypeDefines the type of aDiffGroupand thus how to interpret the content of the affected elements lists.
-
Constructor Summary
Constructors Constructor Description DiffGroup()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.List<com.inet.pdfc.model.PagedElement>getAddedElements()Returns a list of elements which are added or have a new value in the SECOND document.abstract com.inet.pdfc.generator.model.IDiffGroupBoundsgetBoundingElements()Returns the elements which define the bounds of the group in the element flow of the first and second document.abstract java.awt.RectanglegetBounds(boolean first)Returns the overall outline of all affected elements of this group in one of the documents.DifferencePagesgetDifferencePages(boolean first)Return the difference pageNumbers or null if no elements exist for this documentabstract intgetDifferencesCount()Returns the number modifications in this group.abstract java.util.List<Modification>getModifications()Returns the list of modifications contained in this group.abstract java.util.List<com.inet.pdfc.model.PagedElement>getRemovedElements()Returns a list of elements which are removed or have a modified value in the FIRST document.abstract DiffGroup.GroupTypegetType()Returns the type of differences in this group.abstract booleanisVisible()Returns whether this differences group contains at least one visibleModificationjava.lang.StringtoString()
-
-
-
Method Detail
-
getRemovedElements
public abstract java.util.List<com.inet.pdfc.model.PagedElement> getRemovedElements()
Returns a list of elements which are removed or have a modified value in the FIRST document.
NOTE: The bounds of these element are relative to their page. This is different to the total outline of the difference group, which is relative to the document.- Returns:
- the list of removed or modified elements, not
null - Since:
- 3.0
-
getAddedElements
public abstract java.util.List<com.inet.pdfc.model.PagedElement> getAddedElements()
Returns a list of elements which are added or have a new value in the SECOND document.
NOTE: The bounds of these element are relative to their page. This is different to the total outline of the difference group, which is relative to the document.- Returns:
- the list of added or modified elements, not
null - Since:
- 3.0
-
getBounds
public abstract java.awt.Rectangle getBounds(boolean first)
Returns the overall outline of all affected elements of this group in one of the documents.- Parameters:
first-truefor the first document,false- Returns:
- the outline rectangle
- Since:
- 3.0
-
getDifferencesCount
public abstract int getDifferencesCount()
Returns the number modifications in this group. May return zero if there is no visible modification.- Returns:
- the number modifications in this group
- Since:
- 3.0
-
getBoundingElements
public abstract com.inet.pdfc.generator.model.IDiffGroupBounds getBoundingElements()
Returns the elements which define the bounds of the group in the element flow of the first and second document. This information is useful to determine whether the difference is in-line with the matched content and to place markers at locations where there is some content missing.- Returns:
- the group bounds, never
nullalthough the elements in the bounds instance may all benull - Since:
- 3.0
-
getType
public abstract DiffGroup.GroupType getType()
Returns the type of differences in this group. This type as well defines the severity of theModifications in this group.- Returns:
- the type of differences in this group, never
null - Since:
- 3.0
- See Also:
DiffGroup.GroupType
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getModifications
public abstract java.util.List<Modification> getModifications()
Returns the list of modifications contained in this group. The is the primary entry point to list the differences in a group. Each of these modifications describe one singular modification including the affected elements and the option to get a localized difference description.- Returns:
- the list of modifications, may be
nullfor sync groups - Since:
- 3.0
-
getDifferencePages
public DifferencePages getDifferencePages(boolean first)
Return the difference pageNumbers or null if no elements exist for this document- Parameters:
first-truefor the first document,false- Returns:
- the difference pageNumbers
- Since:
- 4.0
-
isVisible
public abstract boolean isVisible()
Returns whether this differences group contains at least one visibleModification- Returns:
trueif there is at least one visibleModification, hence false- Since:
- 20.04
-
-