Return-Path: X-Original-To: apmail-commons-notifications-archive@minotaur.apache.org Delivered-To: apmail-commons-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8B4261010C for ; Fri, 17 Apr 2015 07:26:49 +0000 (UTC) Received: (qmail 83831 invoked by uid 500); 17 Apr 2015 07:11:49 -0000 Delivered-To: apmail-commons-notifications-archive@commons.apache.org Received: (qmail 75680 invoked by uid 500); 17 Apr 2015 07:11:44 -0000 Mailing-List: contact notifications-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list notifications@commons.apache.org Received: (qmail 59485 invoked by uid 99); 17 Apr 2015 06:46:37 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2015 06:46:37 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id C6527AC0B81 for ; Fri, 17 Apr 2015 06:46:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r947984 [13/36] - in /websites/production/commons/content/sandbox/commons-text: ./ apidocs/ apidocs/org/apache/commons/text/diff/ apidocs/org/apache/commons/text/diff/class-use/ apidocs/org/apache/commons/text/names/ apidocs/org/apache/comm... Date: Fri, 17 Apr 2015 06:46:32 -0000 To: notifications@commons.apache.org From: kinow@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150417064636.C6527AC0B81@hades.apache.org> Added: websites/production/commons/content/sandbox/commons-text/apidocs/serialized-form.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/serialized-form.html (added) +++ websites/production/commons/content/sandbox/commons-text/apidocs/serialized-form.html Fri Apr 17 06:46:28 2015 @@ -0,0 +1,142 @@ + + + + + + +Serialized Form (Apache Commons Text 0.1-SNAPSHOT API) + + + + + + + +
+ + + + + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + + + + + + +
+ + +

Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.

+ + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/CommandVisitor.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/CommandVisitor.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/CommandVisitor.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -125,32 +125,33 @@ 117 * } 118 * </pre> 119 * -120 * @since 1.0 -121 */ -122public interface CommandVisitor<T> { -123 -124 /** -125 * Method called when an insert command is encountered. -126 * -127 * @param object object to insert (this object comes from the second sequence) -128 */ -129 void visitInsertCommand(T object); -130 -131 /** -132 * Method called when a keep command is encountered. -133 * -134 * @param object object to keep (this object comes from the first sequence) -135 */ -136 void visitKeepCommand(T object); -137 -138 /** -139 * Method called when a delete command is encountered. -140 * -141 * @param object object to delete (this object comes from the first sequence) -142 */ -143 void visitDeleteCommand(T object); -144 -145} +120 * @param <T> object type +121 * @since 1.0 +122 */ +123public interface CommandVisitor<T> { +124 +125 /** +126 * Method called when an insert command is encountered. +127 * +128 * @param object object to insert (this object comes from the second sequence) +129 */ +130 void visitInsertCommand(T object); +131 +132 /** +133 * Method called when a keep command is encountered. +134 * +135 * @param object object to keep (this object comes from the first sequence) +136 */ +137 void visitKeepCommand(T object); +138 +139 /** +140 * Method called when a delete command is encountered. +141 * +142 * @param object object to delete (this object comes from the first sequence) +143 */ +144 void visitDeleteCommand(T object); +145 +146} @@ -214,4 +215,4 @@ - \ No newline at end of file + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/DeleteCommand.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/DeleteCommand.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/DeleteCommand.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -37,30 +37,31 @@ 029 * @see StringsComparator 030 * @see EditScript 031 * -032 * @since 1.0 -033 */ -034public class DeleteCommand<T> extends EditCommand<T> { -035 -036 /** -037 * Simple constructor. Creates a new instance of {@link DeleteCommand}. -038 * -039 * @param object the object of the first sequence that should be deleted -040 */ -041 public DeleteCommand(final T object) { -042 super(object); -043 } -044 -045 /** -046 * Accept a visitor. When a <code>DeleteCommand</code> accepts a visitor, it calls -047 * its {@link CommandVisitor#visitDeleteCommand visitDeleteCommand} method. -048 * -049 * @param visitor the visitor to be accepted -050 */ -051 @Override -052 public void accept(final CommandVisitor<T> visitor) { -053 visitor.visitDeleteCommand(getObject()); -054 } -055} +032 * @param <T> object type +033 * @since 1.0 +034 */ +035public class DeleteCommand<T> extends EditCommand<T> { +036 +037 /** +038 * Simple constructor. Creates a new instance of {@link DeleteCommand}. +039 * +040 * @param object the object of the first sequence that should be deleted +041 */ +042 public DeleteCommand(final T object) { +043 super(object); +044 } +045 +046 /** +047 * Accept a visitor. When a <code>DeleteCommand</code> accepts a visitor, it calls +048 * its {@link CommandVisitor#visitDeleteCommand visitDeleteCommand} method. +049 * +050 * @param visitor the visitor to be accepted +051 */ +052 @Override +053 public void accept(final CommandVisitor<T> visitor) { +054 visitor.visitDeleteCommand(getObject()); +055 } +056} @@ -124,4 +125,4 @@ - \ No newline at end of file + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/EditCommand.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/EditCommand.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/EditCommand.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -56,43 +56,44 @@ 048 * @see StringsComparator 049 * @see EditScript 050 * -051 * @since 1.0 -052 */ -053public abstract class EditCommand<T> { -054 -055 /** Object on which the command should be applied. */ -056 private final T object; -057 -058 /** -059 * Simple constructor. Creates a new instance of EditCommand -060 * -061 * @param object reference to the object associated with this command, this -062 * refers to an element of one of the sequences being compared -063 */ -064 protected EditCommand(final T object) { -065 this.object = object; -066 } -067 -068 /** -069 * Returns the object associated with this command. -070 * -071 * @return the object on which the command is applied -072 */ -073 protected T getObject() { -074 return object; -075 } -076 -077 /** -078 * Accept a visitor. -079 * <p> -080 * This method is invoked for each commands belonging to -081 * an {@link EditScript EditScript}, in order to implement the visitor design pattern -082 * -083 * @param visitor the visitor to be accepted -084 */ -085 public abstract void accept(CommandVisitor<T> visitor); -086 -087} +051 * @param <T> object type +052 * @since 1.0 +053 */ +054public abstract class EditCommand<T> { +055 +056 /** Object on which the command should be applied. */ +057 private final T object; +058 +059 /** +060 * Simple constructor. Creates a new instance of EditCommand +061 * +062 * @param object reference to the object associated with this command, this +063 * refers to an element of one of the sequences being compared +064 */ +065 protected EditCommand(final T object) { +066 this.object = object; +067 } +068 +069 /** +070 * Returns the object associated with this command. +071 * +072 * @return the object on which the command is applied +073 */ +074 protected T getObject() { +075 return object; +076 } +077 +078 /** +079 * Accept a visitor. +080 * <p> +081 * This method is invoked for each commands belonging to +082 * an {@link EditScript EditScript}, in order to implement the visitor design pattern +083 * +084 * @param visitor the visitor to be accepted +085 */ +086 public abstract void accept(CommandVisitor<T> visitor); +087 +088} @@ -156,4 +157,4 @@ - \ No newline at end of file + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/EditScript.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/EditScript.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/EditScript.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -48,96 +48,97 @@ 040 * @see CommandVisitor 041 * @see ReplacementsHandler 042 * -043 * @since 1.0 -044 */ -045public class EditScript<T> { -046 -047 /** Container for the commands. */ -048 private final List<EditCommand<T>> commands; -049 -050 /** Length of the longest common subsequence. */ -051 private int lcsLength; -052 -053 /** Number of modifications. */ -054 private int modifications; -055 -056 /** -057 * Simple constructor. Creates a new empty script. -058 */ -059 public EditScript() { -060 commands = new ArrayList<EditCommand<T>>(); -061 lcsLength = 0; -062 modifications = 0; -063 } -064 -065 /** -066 * Add a keep command to the script. -067 * -068 * @param command command to add -069 */ -070 public void append(final KeepCommand<T> command) { -071 commands.add(command); -072 ++lcsLength; -073 } -074 -075 /** -076 * Add an insert command to the script. -077 * -078 * @param command command to add -079 */ -080 public void append(final InsertCommand<T> command) { -081 commands.add(command); -082 ++modifications; -083 } -084 -085 /** -086 * Add a delete command to the script. -087 * -088 * @param command command to add -089 */ -090 public void append(final DeleteCommand<T> command) { -091 commands.add(command); -092 ++modifications; -093 } -094 -095 /** -096 * Visit the script. The script implements the <em>visitor</em> design -097 * pattern, this method is the entry point to which the user supplies its -098 * own visitor, the script will be responsible to drive it through the -099 * commands in order and call the appropriate method as each command is -100 * encountered. -101 * -102 * @param visitor the visitor that will visit all commands in turn -103 */ -104 public void visit(final CommandVisitor<T> visitor) { -105 for (final EditCommand<T> command : commands) { -106 command.accept(visitor); -107 } -108 } -109 -110 /** -111 * Get the length of the Longest Common Subsequence (LCS). The length of the -112 * longest common subsequence is the number of {@link KeepCommand keep -113 * commands} in the script. -114 * -115 * @return length of the Longest Common Subsequence -116 */ -117 public int getLCSLength() { -118 return lcsLength; -119 } -120 -121 /** -122 * Get the number of effective modifications. The number of effective -123 * modification is the number of {@link DeleteCommand delete} and -124 * {@link InsertCommand insert} commands in the script. -125 * -126 * @return number of effective modifications -127 */ -128 public int getModifications() { -129 return modifications; -130 } -131 -132} +043 * @param <T> object type +044 * @since 1.0 +045 */ +046public class EditScript<T> { +047 +048 /** Container for the commands. */ +049 private final List<EditCommand<T>> commands; +050 +051 /** Length of the longest common subsequence. */ +052 private int lcsLength; +053 +054 /** Number of modifications. */ +055 private int modifications; +056 +057 /** +058 * Simple constructor. Creates a new empty script. +059 */ +060 public EditScript() { +061 commands = new ArrayList<EditCommand<T>>(); +062 lcsLength = 0; +063 modifications = 0; +064 } +065 +066 /** +067 * Add a keep command to the script. +068 * +069 * @param command command to add +070 */ +071 public void append(final KeepCommand<T> command) { +072 commands.add(command); +073 ++lcsLength; +074 } +075 +076 /** +077 * Add an insert command to the script. +078 * +079 * @param command command to add +080 */ +081 public void append(final InsertCommand<T> command) { +082 commands.add(command); +083 ++modifications; +084 } +085 +086 /** +087 * Add a delete command to the script. +088 * +089 * @param command command to add +090 */ +091 public void append(final DeleteCommand<T> command) { +092 commands.add(command); +093 ++modifications; +094 } +095 +096 /** +097 * Visit the script. The script implements the <em>visitor</em> design +098 * pattern, this method is the entry point to which the user supplies its +099 * own visitor, the script will be responsible to drive it through the +100 * commands in order and call the appropriate method as each command is +101 * encountered. +102 * +103 * @param visitor the visitor that will visit all commands in turn +104 */ +105 public void visit(final CommandVisitor<T> visitor) { +106 for (final EditCommand<T> command : commands) { +107 command.accept(visitor); +108 } +109 } +110 +111 /** +112 * Get the length of the Longest Common Subsequence (LCS). The length of the +113 * longest common subsequence is the number of {@link KeepCommand keep +114 * commands} in the script. +115 * +116 * @return length of the Longest Common Subsequence +117 */ +118 public int getLCSLength() { +119 return lcsLength; +120 } +121 +122 /** +123 * Get the number of effective modifications. The number of effective +124 * modification is the number of {@link DeleteCommand delete} and +125 * {@link InsertCommand insert} commands in the script. +126 * +127 * @return number of effective modifications +128 */ +129 public int getModifications() { +130 return modifications; +131 } +132 +133} @@ -201,4 +202,4 @@ - \ No newline at end of file + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/InsertCommand.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/InsertCommand.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/InsertCommand.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -37,32 +37,33 @@ 029 * @see StringsComparator 030 * @see EditScript 031 * -032 * @since 1.0 -033 */ -034public class InsertCommand<T> extends EditCommand<T> { -035 -036 /** -037 * Simple constructor. Creates a new instance of InsertCommand -038 * -039 * @param object the object of the second sequence that should be inserted -040 */ -041 public InsertCommand(final T object) { -042 super(object); -043 } -044 -045 /** -046 * Accept a visitor. When an <code>InsertCommand</code> accepts a visitor, -047 * it calls its {@link CommandVisitor#visitInsertCommand visitInsertCommand} -048 * method. -049 * -050 * @param visitor the visitor to be accepted -051 */ -052 @Override -053 public void accept(final CommandVisitor<T> visitor) { -054 visitor.visitInsertCommand(getObject()); -055 } -056 -057} +032 * @param <T> object type +033 * @since 1.0 +034 */ +035public class InsertCommand<T> extends EditCommand<T> { +036 +037 /** +038 * Simple constructor. Creates a new instance of InsertCommand +039 * +040 * @param object the object of the second sequence that should be inserted +041 */ +042 public InsertCommand(final T object) { +043 super(object); +044 } +045 +046 /** +047 * Accept a visitor. When an <code>InsertCommand</code> accepts a visitor, +048 * it calls its {@link CommandVisitor#visitInsertCommand visitInsertCommand} +049 * method. +050 * +051 * @param visitor the visitor to be accepted +052 */ +053 @Override +054 public void accept(final CommandVisitor<T> visitor) { +055 visitor.visitInsertCommand(getObject()); +056 } +057 +058} @@ -126,4 +127,4 @@ - \ No newline at end of file + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/KeepCommand.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/KeepCommand.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/KeepCommand.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -37,32 +37,33 @@ 029 * @see StringsComparator 030 * @see EditScript 031 * -032 * @since 1.0 -033 */ -034public class KeepCommand<T> extends EditCommand<T> { -035 -036 /** -037 * Simple constructor. Creates a new instance of KeepCommand -038 * -039 * @param object the object belonging to both sequences (the object is a -040 * reference to the instance in the first sequence which is known -041 * to be equal to an instance in the second sequence) -042 */ -043 public KeepCommand(final T object) { -044 super(object); -045 } -046 -047 /** -048 * Accept a visitor. When a <code>KeepCommand</code> accepts a visitor, it -049 * calls its {@link CommandVisitor#visitKeepCommand visitKeepCommand} method. -050 * -051 * @param visitor the visitor to be accepted -052 */ -053 @Override -054 public void accept(final CommandVisitor<T> visitor) { -055 visitor.visitKeepCommand(getObject()); -056 } -057} +032 * @param <T> object type +033 * @since 1.0 +034 */ +035public class KeepCommand<T> extends EditCommand<T> { +036 +037 /** +038 * Simple constructor. Creates a new instance of KeepCommand +039 * +040 * @param object the object belonging to both sequences (the object is a +041 * reference to the instance in the first sequence which is known +042 * to be equal to an instance in the second sequence) +043 */ +044 public KeepCommand(final T object) { +045 super(object); +046 } +047 +048 /** +049 * Accept a visitor. When a <code>KeepCommand</code> accepts a visitor, it +050 * calls its {@link CommandVisitor#visitKeepCommand visitKeepCommand} method. +051 * +052 * @param visitor the visitor to be accepted +053 */ +054 @Override +055 public void accept(final CommandVisitor<T> visitor) { +056 visitor.visitKeepCommand(getObject()); +057 } +058} @@ -126,4 +127,4 @@ - \ No newline at end of file + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/ReplacementsFinder.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/ReplacementsFinder.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/ReplacementsFinder.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -55,68 +55,78 @@ 047 * @see EditScript 048 * @see StringsComparator 049 * -050 * @since 1.0 -051 */ -052public class ReplacementsFinder<T> implements CommandVisitor<T> { -053 -054 private final List<T> pendingInsertions; -055 private final List<T> pendingDeletions; -056 private int skipped; -057 -058 /** Handler to call when synchronized sequences are found. */ -059 private final ReplacementsHandler<T> handler; -060 -061 /** -062 * Simple constructor. Creates a new instance of {@link ReplacementsFinder}. -063 * -064 * @param handler handler to call when synchronized sequences are found +050 * @param <T> object type +051 * @since 1.0 +052 */ +053public class ReplacementsFinder<T> implements CommandVisitor<T> { +054 +055 /** +056 * List of pending insertions. +057 */ +058 private final List<T> pendingInsertions; +059 /** +060 * List of pending deletions. +061 */ +062 private final List<T> pendingDeletions; +063 /** +064 * Count of elements skipped. 065 */ -066 public ReplacementsFinder(final ReplacementsHandler<T> handler) { -067 pendingInsertions = new ArrayList<T>(); -068 pendingDeletions = new ArrayList<T>(); -069 skipped = 0; -070 this.handler = handler; -071 } -072 -073 /** -074 * Add an object to the pending insertions set. -075 * -076 * @param object object to insert -077 */ -078 public void visitInsertCommand(final T object) { -079 pendingInsertions.add(object); -080 } -081 -082 /** -083 * Handle a synchronization object. -084 * <p> -085 * When a synchronization object is identified, the pending insertions and -086 * pending deletions sets are provided to the user handler as subsequences. -087 * </p> -088 * -089 * @param object synchronization object detected -090 */ -091 public void visitKeepCommand(final T object) { -092 if (pendingDeletions.isEmpty() && pendingInsertions.isEmpty()) { -093 ++skipped; -094 } else { -095 handler.handleReplacement(skipped, pendingDeletions, pendingInsertions); -096 pendingDeletions.clear(); -097 pendingInsertions.clear(); -098 skipped = 1; -099 } -100 } -101 -102 /** -103 * Add an object to the pending deletions set. -104 * -105 * @param object object to delete -106 */ -107 public void visitDeleteCommand(final T object) { -108 pendingDeletions.add(object); -109 } -110 -111} +066 private int skipped; +067 +068 /** Handler to call when synchronized sequences are found. */ +069 private final ReplacementsHandler<T> handler; +070 +071 /** +072 * Simple constructor. Creates a new instance of {@link ReplacementsFinder}. +073 * +074 * @param handler handler to call when synchronized sequences are found +075 */ +076 public ReplacementsFinder(final ReplacementsHandler<T> handler) { +077 pendingInsertions = new ArrayList<T>(); +078 pendingDeletions = new ArrayList<T>(); +079 skipped = 0; +080 this.handler = handler; +081 } +082 +083 /** +084 * Add an object to the pending insertions set. +085 * +086 * @param object object to insert +087 */ +088 public void visitInsertCommand(final T object) { +089 pendingInsertions.add(object); +090 } +091 +092 /** +093 * Handle a synchronization object. +094 * <p> +095 * When a synchronization object is identified, the pending insertions and +096 * pending deletions sets are provided to the user handler as subsequences. +097 * </p> +098 * +099 * @param object synchronization object detected +100 */ +101 public void visitKeepCommand(final T object) { +102 if (pendingDeletions.isEmpty() && pendingInsertions.isEmpty()) { +103 ++skipped; +104 } else { +105 handler.handleReplacement(skipped, pendingDeletions, pendingInsertions); +106 pendingDeletions.clear(); +107 pendingInsertions.clear(); +108 skipped = 1; +109 } +110 } +111 +112 /** +113 * Add an object to the pending deletions set. +114 * +115 * @param object object to delete +116 */ +117 public void visitDeleteCommand(final T object) { +118 pendingDeletions.add(object); +119 } +120 +121} @@ -180,4 +190,4 @@ - \ No newline at end of file + Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/ReplacementsHandler.html ============================================================================== --- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/ReplacementsHandler.html (original) +++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/diff/ReplacementsHandler.html Fri Apr 17 06:46:28 2015 @@ -1,5 +1,5 @@ - + Source code @@ -29,34 +29,35 @@ 021/** 022 * This interface is devoted to handle synchronized replacement sequences. 023 * -024 * @see ReplacementsFinder -025 * @since 1.0 -026 */ -027public interface ReplacementsHandler<T> { -028 -029 /** -030 * Handle two synchronized sequences. -031 * <p> -032 * This method is called by a {@link ReplacementsFinder ReplacementsFinder} -033 * instance when it has synchronized two sub-sequences of object arrays -034 * being compared, and at least one of the sequences is non-empty. Since the -035 * sequences are synchronized, the objects before the two sub-sequences are -036 * equals (if they exist). This property also holds for the objects after -037 * the two sub-sequences. -038 * <p> -039 * The replacement is defined as replacing the <code>from</code> -040 * sub-sequence into the <code>to</code> sub-sequence. -041 * -042 * @param skipped number of tokens skipped since the last call (i.e. number of -043 * tokens that were in both sequences), this number should be strictly positive -044 * except on the very first call where it can be zero (if the first object of -045 * the two sequences are different) -046 * @param from sub-sequence of objects coming from the first sequence -047 * @param to sub-sequence of objects coming from the second sequence -048 */ -049 void handleReplacement(int skipped, List<T> from, List<T> to); -050 -051} +024 * @param <T> object type +025 * @see ReplacementsFinder +026 * @since 1.0 +027 */ +028public interface ReplacementsHandler<T> { +029 +030 /** +031 * Handle two synchronized sequences. +032 * <p> +033 * This method is called by a {@link ReplacementsFinder ReplacementsFinder} +034 * instance when it has synchronized two sub-sequences of object arrays +035 * being compared, and at least one of the sequences is non-empty. Since the +036 * sequences are synchronized, the objects before the two sub-sequences are +037 * equals (if they exist). This property also holds for the objects after +038 * the two sub-sequences. +039 * <p> +040 * The replacement is defined as replacing the <code>from</code> +041 * sub-sequence into the <code>to</code> sub-sequence. +042 * +043 * @param skipped number of tokens skipped since the last call (i.e. number of +044 * tokens that were in both sequences), this number should be strictly positive +045 * except on the very first call where it can be zero (if the first object of +046 * the two sequences are different) +047 * @param from sub-sequence of objects coming from the first sequence +048 * @param to sub-sequence of objects coming from the second sequence +049 */ +050 void handleReplacement(int skipped, List<T> from, List<T> to); +051 +052} @@ -120,4 +121,4 @@ - \ No newline at end of file +