Package ca.cgjennings.algo
Interface DiffListener<E>
-
- Type Parameters:
E- the type of the elements that may be inserted, deleted, or changed; for example, in a text file each element might be aStringrepresenting a single line
public interface DiffListener<E>A listener that receives results from theDiffalgorithm.- Since:
- 2.1
- Author:
- Chris Jennings
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinserted(java.lang.Object original, java.lang.Object changed, int originalIndex, E insertedelement)Called to indicate that an element has been inserted to create the changed sequence.voidremoved(java.lang.Object original, java.lang.Object changed, int originalIndex, E removedelement)Called to indicate that an element has been removed to create the changed sequence.voidunchanged(java.lang.Object original, java.lang.Object changed, int originalIndex, E element)Called to indicate that an element was copied without change from the original to the changed sequence.
-
-
-
Method Detail
-
unchanged
void unchanged(java.lang.Object original, java.lang.Object changed, int originalIndex, E element)Called to indicate that an element was copied without change from the original to the changed sequence.- Parameters:
original- the array or list that was passed toDiff.findChanges(E[], E[])as the parameter namedoriginalchanged- the array or list that was passed toDiff.findChanges(E[], E[])as the parameter namedchangedoriginalIndex- the index in the original sequence at which this event occurselement- the original element
-
inserted
void inserted(java.lang.Object original, java.lang.Object changed, int originalIndex, E insertedelement)Called to indicate that an element has been inserted to create the changed sequence.- Parameters:
original- the array or list that was passed toDiff.findChanges(E[], E[])as the parameter namedoriginalchanged- the array or list that was passed toDiff.findChanges(E[], E[])as the parameter namedchangedoriginalIndex- the index in the original sequence at which this event occursinsertedelement- the element from the changed sequence that must be inserted
-
removed
void removed(java.lang.Object original, java.lang.Object changed, int originalIndex, E removedelement)Called to indicate that an element has been removed to create the changed sequence.- Parameters:
original- the array or list that was passed toDiff.findChanges(E[], E[])as the parameter namedoriginalchanged- the array or list that was passed toDiff.findChanges(E[], E[])as the parameter namedchangedoriginalIndex- the index in the original sequence at which this event occursremovedelement- the element from the changed sequence that must be inserted
-
-