org.eclipse.compare.StringComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docx4j Show documentation
Show all versions of docx4j Show documentation
docx4j is a library which helps you to work with the Office Open
XML file format as used in docx
documents, pptx presentations, and xlsx spreadsheets.
package org.eclipse.compare;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.compare.internal.LCSSettings;
import org.eclipse.compare.rangedifferencer.IRangeComparator;
import org.eclipse.compare.rangedifferencer.RangeDifference;
import org.eclipse.compare.rangedifferencer.RangeDifferencer;
/**
* A comparator that compares strings.
*/
public class StringComparator implements IRangeComparator {
private List leafs = new ArrayList();
public StringComparator(String paragraphContent) {
String[] result = paragraphContent.split("\\s");
for (int x=0; x