org.eclipse.jpt.core.utility
Class TextRange.Empty

java.lang.Object
  extended by org.eclipse.jpt.core.utility.TextRange.Empty
All Implemented Interfaces:
TextRange
Enclosing interface:
TextRange

public static final class TextRange.Empty
extends java.lang.Object
implements TextRange

Empty implementation of text range.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.core.utility.TextRange
TextRange.Empty
 
Field Summary
static TextRange INSTANCE
           
 
Method Summary
 boolean equals(java.lang.Object o)
          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.
static TextRange instance()
           
 java.lang.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
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final TextRange INSTANCE
Method Detail

instance

public static TextRange instance()

getOffset

public int getOffset()
Description copied from interface: TextRange
Returns the offset of the text.

Specified by:
getOffset in interface TextRange
Returns:
the offset of the text

getLength

public int getLength()
Description copied from interface: TextRange
Return the length of the text.

Specified by:
getLength in interface TextRange

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

getLineNumber

public int getLineNumber()
Description copied from interface: TextRange
Return the line number of the text.

Specified by:
getLineNumber in interface TextRange

equals

public boolean equals(java.lang.Object o)
Description copied from interface: TextRange
Return true if the offsets and lengths are the same.

Specified by:
equals in interface TextRange
Overrides:
equals in class java.lang.Object

hashCode

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

Specified by:
hashCode in interface TextRange
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object