Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.compare.rangedifferencer
Interface IRangeComparator

All Known Subinterfaces:
ITokenComparator
All Known Implementing Classes:
TokenComparator

public interface IRangeComparator

For breaking an object to compare into a sequence of comparable entities.

It is used by RangeDifferencer to find longest sequences of matching and non-matching ranges.

For example, to compare two text documents and find longest common sequences of matching and non-matching lines, the implementation must break the document into lines. getRangeCount would return the number of lines in the document, and rangesEqual would compare a specified line given with one in another IRangeComparator.

Clients should implement this interface; there is no standard implementation.


Method Summary
 int getRangeCount ()
          Returns the number of comparable entities.
 boolean rangesEqual (int thisIndex, IRangeComparator other, int otherIndex)
          Returns whether the comparable entity given by the first index matches an entity specified by the other IRangeComparator and index.
 boolean skipRangeComparison (int length, int maxLength, IRangeComparator other)
          Returns whether a comparison should be skipped because it would be too costly (or lengthy).
 

Method Detail

getRangeCount

int getRangeCount()
Returns the number of comparable entities.

Returns:
the number of comparable entities

rangesEqual

boolean rangesEqual(int thisIndex,
                    
IRangeComparator other,
                    int otherIndex)
Returns whether the comparable entity given by the first index matches an entity specified by the other IRangeComparator and index.

Parameters:
thisIndex - the index of the comparable entity within this IRangeComparator
other - the IRangeComparator to compare this with
otherIndex - the index of the comparable entity within the other IRangeComparator
Returns:
true if the comparable entities are equal

skipRangeComparison

boolean skipRangeComparison(int length,
                            int maxLength,
                            
IRangeComparator other)
Returns whether a comparison should be skipped because it would be too costly (or lengthy).

Parameters:
length - a number on which to base the decision whether to return true or false
maxLength - another number on which to base the decision whether to return true or false
other - the other IRangeComparator to compare with
Returns:
true to avoid a too lengthy range comparison

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire