org.eclipse.jpt.core.utility
Interface TextRange

All Known Implementing Classes:
AbstractTextRange, TextRange.Empty

public interface TextRange

A text range defines the offset into, length of, and line of a piece of text. Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. This interface is not intended to be implemented by clients.


Nested Class Summary
static class TextRange.Empty
          Empty implementation of text range.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Return true if the offsets and lengths are the same.
 int getLength()
          Return the length of the text.
 int getLineNumber()
          Return the line number of the text.
 int getOffset()
          Returns the offset of the text.
 int hashCode()
          Return a hash code that corresponds to the #equals() contract.
 boolean includes(int index)
          Return whether the range includes the character at the specified index.
 boolean touches(int index)
          Return whether the range touches an insertion cursor at the specified index.
 

Method Detail

getOffset

int getOffset()
Returns the offset of the text.

Returns:
the offset of the text

getLength

int getLength()
Return the length of the text.


includes

boolean includes(int index)
Return whether the range includes the character at the specified index.


touches

boolean touches(int index)
Return whether the range touches an insertion cursor at the specified index.


getLineNumber

int getLineNumber()
Return the line number of the text.


equals

boolean equals(java.lang.Object obj)
Return true if the offsets and lengths are the same.

Overrides:
equals in class java.lang.Object

hashCode

int hashCode()
Return a hash code that corresponds to the #equals() contract.

Overrides:
hashCode in class java.lang.Object