com.aspose.words
Class Granularity

java.lang.Object
    extended by com.aspose.words.Granularity

public class Granularity 
extends java.lang.Object

Utility class containing constants. Specifies the granularity of changes to track when comparing two documents.

Example:

Shows to specify comparison granularity.
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 tracked by character ('Granularity.CharLevel') or by word ('Granularity.WordLevel')
CompareOptions compareOptions = new CompareOptions();
compareOptions.setGranularity(granularity);

docA.compare(docB, "author", new Date(), compareOptions);

// Revision groups contain all of our text changes
RevisionGroupCollection groups = docA.getRevisions().getGroups();
Assert.assertEquals(5, groups.getCount());

Field Summary
static final intCHAR_LEVEL = 0
          
static final intWORD_LEVEL = 1
          
 

Field Detail

CHAR_LEVEL = 0

public static final int CHAR_LEVEL

WORD_LEVEL = 1

public static final int WORD_LEVEL

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.