public class Granularity
Example:
Document docA = new Document();
DocumentBuilder builderA = new DocumentBuilder(docA);
builderA.writeln("Alpha Lorem ipsum dolor sit amet, consectetur adipiscing elit");
Document docB = new Document();
DocumentBuilder builderB = new DocumentBuilder(docB);
builderB.writeln("Lorems ipsum dolor sit amet consectetur - \"adipiscing\" elit");
// Specify whether changes are tracking
// by character ('Granularity.CharLevel'), or by word ('Granularity.WordLevel').
CompareOptions compareOptions = new CompareOptions();
compareOptions.setGranularity(granularity);
docA.compare(docB, "author", new Date(), compareOptions);
// The first document's collection of revision groups contains all the differences between documents.
RevisionGroupCollection groups = docA.getRevisions().getGroups();
Assert.assertEquals(5, groups.getCount());
Field Summary | ||
---|---|---|
static final int | CHAR_LEVEL | |
static final int | WORD_LEVEL | |