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
Answertopia.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.contentmergeviewer
Interface ITokenComparator

All Superinterfaces:
IRangeComparator
All Known Implementing Classes:
TokenComparator

public interface ITokenComparator
extends IRangeComparator

For performing a so-called "token compare" on a line of text. This interface extends the IRangeComparator interface so that it can be used by the TextMergeViewer.

TextMergeViewer activates the token compare when navigating into a range of differing lines. At first the lines are selected as a block. When navigating into this block the token compare shows for every line the differing token by selecting them.

TextMergeViewer's default token comparator works on characters separated by whitespace. If a different strategy is needed (for example, to use Java tokens in a Java-aware merge viewer), clients may create their own token comparators by implementing this interface (and overriding the TextMergeViewer.createTokenComparator factory method).

See Also:
TextMergeViewer

Method Summary
 int getTokenLength (int index)
          Returns the character length of the token with the given index.
 int getTokenStart (int index)
          Returns the start character position of the token with the given index.
 
Methods inherited from interface org.eclipse.compare.rangedifferencer. IRangeComparator
getRangeCount, rangesEqual, skipRangeComparison
 

Method Detail

getTokenStart

int getTokenStart(int index)
Returns the start character position of the token with the given index. If the index is out of range (but not negative) the character position behind the last character (the length of the input string) is returned.

Parameters:
index - index of the token for which to return the start position
Returns:
the start position of the token with the given index
Throws:
IndexOutOfBoundsException - if index is negative

getTokenLength

int getTokenLength(int index)
Returns the character length of the token with the given index. If the index is out of range (but not negative) the value 0 is returned.

Parameters:
index - index of the token for which to return the start position
Returns:
the character length of the token with the given index
Throws:
IndexOutOfBoundsException - if index is negative

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