Class CountingDiff
java.lang.Object
org.apache.jackrabbit.oak.plugins.document.util.CountingDiff
- All Implemented Interfaces:
NodeStateDiff
A
NodeStateDiff
implementation that counts the differences between
two node states, including their sub tree.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
childNodeAdded
(String name, NodeState after) Called for all added child nodes.boolean
childNodeChanged
(String name, NodeState before, NodeState after) Called for all child nodes that may contain changes between the before and after states.boolean
childNodeDeleted
(String name, NodeState before) Called for all deleted child nodes.static int
countChanges
(NodeState before, NodeState after) int
boolean
propertyAdded
(PropertyState after) Called for all added properties.boolean
propertyChanged
(PropertyState before, PropertyState after) Called for all changed properties.boolean
propertyDeleted
(PropertyState before) Called for all deleted properties.
-
Constructor Details
-
CountingDiff
public CountingDiff()
-
-
Method Details
-
countChanges
-
propertyAdded
Description copied from interface:NodeStateDiff
Called for all added properties.- Specified by:
propertyAdded
in interfaceNodeStateDiff
- Parameters:
after
- property state after the change- Returns:
true
to continue the comparison,false
to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
propertyChanged
Description copied from interface:NodeStateDiff
Called for all changed properties. The names of the given two property states are guaranteed to be the same.- Specified by:
propertyChanged
in interfaceNodeStateDiff
- Parameters:
before
- property state before the changeafter
- property state after the change- Returns:
true
to continue the comparison,false
to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
propertyDeleted
Description copied from interface:NodeStateDiff
Called for all deleted properties.- Specified by:
propertyDeleted
in interfaceNodeStateDiff
- Parameters:
before
- property state before the change- Returns:
true
to continue the comparison,false
to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeAdded
Description copied from interface:NodeStateDiff
Called for all added child nodes.- Specified by:
childNodeAdded
in interfaceNodeStateDiff
- Parameters:
name
- name of the added child nodeafter
- child node state after the change- Returns:
true
to continue the comparison,false
to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeChanged
Description copied from interface:NodeStateDiff
Called for all child nodes that may contain changes between the before and after states. The comparison implementation is expected to make an effort to avoid calling this method on child nodes under which nothing has changed.- Specified by:
childNodeChanged
in interfaceNodeStateDiff
- Parameters:
name
- name of the changed child nodebefore
- child node state before the changeafter
- child node state after the change- Returns:
true
to continue the comparison,false
to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeDeleted
Description copied from interface:NodeStateDiff
Called for all deleted child nodes.- Specified by:
childNodeDeleted
in interfaceNodeStateDiff
- Parameters:
name
- name of the deleted child nodebefore
- child node state before the change- Returns:
true
to continue the comparison,false
to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
getNumChanges
public int getNumChanges()
-