org.outerj.daisy.diff
Class TextComparator

java.lang.Object
  extended by org.outerj.daisy.diff.TextComparator
All Implemented Interfaces:
org.eclipse.compare.rangedifferencer.IRangeComparator

public class TextComparator
extends java.lang.Object
implements org.eclipse.compare.rangedifferencer.IRangeComparator

Comparator for comparing text on a line-by-line basis.


Constructor Summary
TextComparator(java.lang.String text)
           
 
Method Summary
 java.lang.String getLine(int index)
           
 int getRangeCount()
           
 boolean rangesEqual(int thisIndex, org.eclipse.compare.rangedifferencer.IRangeComparator other, int otherIndex)
           
 boolean skipRangeComparison(int length, int maxLength, org.eclipse.compare.rangedifferencer.IRangeComparator other)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextComparator

public TextComparator(java.lang.String text)
Parameters:
text - the input text as one big string (thus containing newlines)
Method Detail

getRangeCount

public int getRangeCount()
Specified by:
getRangeCount in interface org.eclipse.compare.rangedifferencer.IRangeComparator

rangesEqual

public boolean rangesEqual(int thisIndex,
                           org.eclipse.compare.rangedifferencer.IRangeComparator other,
                           int otherIndex)
Specified by:
rangesEqual in interface org.eclipse.compare.rangedifferencer.IRangeComparator

skipRangeComparison

public boolean skipRangeComparison(int length,
                                   int maxLength,
                                   org.eclipse.compare.rangedifferencer.IRangeComparator other)
Specified by:
skipRangeComparison in interface org.eclipse.compare.rangedifferencer.IRangeComparator

getLine

public java.lang.String getLine(int index)


Copyright © -2012 . All Rights Reserved.