| java.lang.Object org.jahia.sqlprofiler.StringDiff
StringDiff | public class StringDiff (Code) | | Title: StringDiff
Description: This class implements a string comparison algorithm that
allows to know the similirity sequences, etc. The main method is the diff
method which performs the difference algorithm and sets all the other
variables.
Copyright: Copyright (c) 2003
Company: Jahia Ltd
author: Serge Huber version: 1.0 |
Inner Class :public class SequencePos | |
StringDiff | public StringDiff()(Code) | | |
diff | public void diff(String left, String right)(Code) | | This is the main method of this class, that actually performs the
matching between the two strings. The result of this operation is stored
in class fields such as leftSequences and rightSequences, sameCharCount,
sequenceCount, etc... These results stay available until the next call
to the diff method is done.
Parameters: left - the first string to compare Parameters: right - the second string to compare the first one with |
getLeft | public String getLeft()(Code) | | the last used left string |
getLeftSequences | public java.util.ArrayList getLeftSequences()(Code) | | Returns the array of sequence positions of similar chars for the left
string
an ArrayList of SequencePos objects that contain the position ofthe sequences that were found in both strings. |
getRight | public String getRight()(Code) | | the last used right string |
getRightSequences | public java.util.ArrayList getRightSequences()(Code) | | Returns the array of sequence positions of similar chars for the right
string
an ArrayList of SequencePos objects that contain the position ofthe sequences that were found in both strings. |
getSameCharCount | public int getSameCharCount()(Code) | | the full count of characters that are in all the sequences thatare the same between both strings |
getSequenceCount | public int getSequenceCount()(Code) | | the number of sequences that are present in both strings |
main | public static void main(String[] args)(Code) | | Runs a few tests cases to make sure the diff algorithm is correct.
Parameters: args - |
|
|