ChangeInfo
Inheritance: java.lang.Object
public class ChangeInfo
The ChangeInfo class represents information about a specific change in a document comparison.
It provides details such as the type of change, the affected area, and the content before and after the change. Use this class to retrieve information about individual changes within a comparison result.
Example usage:
try (Comparer comparer = new Comparer(sourceFile)) {
comparer.add(targetFile);
comparer.compare(resultFile);
// Get a list of changes from the comparison result
ChangeInfo[] changes = comparer.getChanges();
// Iterate through the changes and retrieve information
for (ChangeInfo change : changes) {
ChangeType changeType = change.getType();
String componentType = change.getComponentType();
PageInfo pageInfo = change.getPageInfo();
// Process the change information as needed
// ...
}
}
Constructors
Constructor | Description |
---|---|
ChangeInfo() |
Methods
Method | Description |
---|---|
getId() | Gets unique id of the change. |
setId(int value) | Sets unique id of the change. |
getComparisonAction() | Gets the action that will be applied to the change. |
setComparisonAction(ComparisonAction value) | Sets the action that should be applied to the change. |
getPageInfo() | Gets information about the page, on which current change was found. |
setPageInfo(PageInfo value) | Sets information about the page, on which current change was found. |
getBox() | Gets coordinates of changed element on the page. |
setBox(Rectangle value) | Sets coordinates of changed element on the page. |
getText() | Gets text value of the change. |
setText(String value) | Sets text value of the change. |
getStyleChanges() | Gets the list of style changes. |
setStyleChanges(List |
Sets the list of style changes. |
getAuthors() | Gets the list of authors. |
setAuthors(List |
Sets the list of authors. |
getType() | Gets the type of the change represented by enum ChangeType. |
getTargetText() | Gets changed text from target document. |
setTargetText(String value) | Sets changed text from target document. |
getSourceText() | Gets changed text from source document. |
setSourceText(String value) | Sets changed text from source document. |
getComponentType() | Gets the type of the changed component. |
setComponentType(String value) | Sets the type of the changed component. |
toString() |
ChangeInfo()
public ChangeInfo()
getId()
public final int getId()
Gets unique id of the change.
Returns: int - the id of the change
setId(int value)
public final void setId(int value)
Sets unique id of the change.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The id of the change |
getComparisonAction()
public final ComparisonAction getComparisonAction()
Gets the action that will be applied to the change.
Action (ComparisonAction.ACCEPT or ComparisonAction.REJECT) tells comparison what to do with this change.
Returns: ComparisonAction - the action that will be applied to the change
setComparisonAction(ComparisonAction value)
public final void setComparisonAction(ComparisonAction value)
Sets the action that should be applied to the change.
Action (ComparisonAction.ACCEPT or ComparisonAction.REJECT) tells comparison what to do with this change.
Parameters:
Parameter | Type | Description |
---|---|---|
value | ComparisonAction | The action that should be applied to the change |
getPageInfo()
public final PageInfo getPageInfo()
Gets information about the page, on which current change was found.
Returns: PageInfo - information about the page
setPageInfo(PageInfo value)
public final void setPageInfo(PageInfo value)
Sets information about the page, on which current change was found.
Parameters:
Parameter | Type | Description |
---|---|---|
value | PageInfo | Information about the page |
getBox()
public final Rectangle getBox()
Gets coordinates of changed element on the page.
Returns: Rectangle - coordinates of changed element
setBox(Rectangle value)
public final void setBox(Rectangle value)
Sets coordinates of changed element on the page.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Rectangle | Coordinates of changed element, not null |
getText()
public final String getText()
Gets text value of the change.
Returns: java.lang.String - text value of the change
setText(String value)
public final void setText(String value)
Sets text value of the change.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | Text value of the change |
getStyleChanges()
public final List<StyleChangeInfo> getStyleChanges()
Gets the list of style changes.
Returns: java.util.List<com.groupdocs.comparison.result.StyleChangeInfo> - the list of style changes
setStyleChanges(List value)
public final void setStyleChanges(List<StyleChangeInfo> value)
Sets the list of style changes.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.util.List<com.groupdocs.comparison.result.StyleChangeInfo> | The list of style changes |
getAuthors()
public final List<String> getAuthors()
Gets the list of authors.
Returns: java.util.List<java.lang.String> - the list of authors
setAuthors(List value)
public final void setAuthors(List<String> value)
Sets the list of authors.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.util.List<java.lang.String> | The list of authors |
getType()
public final ChangeType getType()
Gets the type of the change represented by enum ChangeType.
Returns: ChangeType - the type of the change
getTargetText()
public String getTargetText()
Gets changed text from target document.
Returns: java.lang.String - the changed text
setTargetText(String value)
public void setTargetText(String value)
Sets changed text from target document.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | The changed text |
getSourceText()
public String getSourceText()
Gets changed text from source document.
Returns: java.lang.String - the changed text
setSourceText(String value)
public void setSourceText(String value)
Sets changed text from source document.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | The changed text |
getComponentType()
public String getComponentType()
Gets the type of the changed component.
Returns: java.lang.String - the type of the changed component
setComponentType(String value)
public void setComponentType(String value)
Sets the type of the changed component.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | The type of the changed component |
toString()
public String toString()
Returns: java.lang.String