Dali Provisional API
Release 3.2

org.eclipse.jpt.common.core.utility
Class AbstractTextRange

java.lang.Object
  extended by org.eclipse.jpt.common.core.utility.AbstractTextRange
All Implemented Interfaces:
TextRange
Direct Known Subclasses:
TextRange.Empty

public abstract class AbstractTextRange
extends Object
implements TextRange

Partial implementation of text range. Provisional API: This class 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.

Since:
2.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.utility.TextRange
TextRange.Empty
 
Constructor Summary
protected AbstractTextRange()
           
 
Method Summary
 TextRange buildTextRange(int offset, int length, int lineNumber)
          Build and return a new text range for the specified values if they differ from the text range.
 boolean equals(Object o)
          Return whether the offsets, lengths, and line numbers are the same.
protected  int getEnd()
          The end offset is exclusive, i.e. the element at the end offset is not included in the range.
 int hashCode()
          Return a hash code that corresponds to the Object.equals(Object) contract.
 boolean includes(int index)
          Return whether the range includes the character at the specified index.
 String toString()
           
 boolean touches(int index)
          Return whether the range touches an insertion cursor at the specified index.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jpt.common.core.utility.TextRange
getLength, getLineNumber, getOffset
 

Constructor Detail

AbstractTextRange

protected AbstractTextRange()
Method Detail

includes

public boolean includes(int index)
Description copied from interface: TextRange
Return whether the range includes the character at the specified index.

Specified by:
includes in interface TextRange

touches

public boolean touches(int index)
Description copied from interface: TextRange
Return whether the range touches an insertion cursor at the specified index.

Specified by:
touches in interface TextRange

getEnd

protected int getEnd()
The end offset is exclusive, i.e. the element at the end offset is not included in the range.


buildTextRange

public TextRange buildTextRange(int offset,
                                int length,
                                int lineNumber)
Description copied from interface: TextRange
Build and return a new text range for the specified values if they differ from the text range. If the specified values match the text range, simply return the text range unchanged.

Specified by:
buildTextRange in interface TextRange

equals

public boolean equals(Object o)
Description copied from interface: TextRange
Return whether the offsets, lengths, and line numbers are the same.

Specified by:
equals in interface TextRange
Overrides:
equals in class Object

hashCode

public int hashCode()
Description copied from interface: TextRange
Return a hash code that corresponds to the Object.equals(Object) contract.

Specified by:
hashCode in interface TextRange
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.