org.eclipse.mylyn.wikitext.core.util
Class LocatorImpl

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.util.LocatorImpl
All Implemented Interfaces:
Locator

public class LocatorImpl
extends Object
implements Locator

Since:
1.0
Author:
David Green

Constructor Summary
LocatorImpl(Locator other)
           
 
Method Summary
 int getDocumentOffset()
          get the 0-based character offset of the current character from the start of the document.
 int getLineCharacterOffset()
          get the 0-based offset of the current character in the current line
 int getLineDocumentOffset()
          get the 0-based character offset of the current line from the start of the document
 int getLineLength()
          get the length of the current line in characters, not including the line terminator
 int getLineNumber()
          get the 1-based number of the current line.
 int getLineSegmentEndOffset()
          Get the 0-based offset of the end of the current line segment being processed, exclusive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocatorImpl

public LocatorImpl(Locator other)
Method Detail

getDocumentOffset

public int getDocumentOffset()
Description copied from interface: Locator
get the 0-based character offset of the current character from the start of the document. Equivalent to getLineDocumentOffset()+getLineCharacterOffset()

Specified by:
getDocumentOffset in interface Locator

getLineCharacterOffset

public int getLineCharacterOffset()
Description copied from interface: Locator
get the 0-based offset of the current character in the current line

Specified by:
getLineCharacterOffset in interface Locator

getLineDocumentOffset

public int getLineDocumentOffset()
Description copied from interface: Locator
get the 0-based character offset of the current line from the start of the document

Specified by:
getLineDocumentOffset in interface Locator
Returns:
the offset or -1 if unknown

getLineLength

public int getLineLength()
Description copied from interface: Locator
get the length of the current line in characters, not including the line terminator

Specified by:
getLineLength in interface Locator

getLineNumber

public int getLineNumber()
Description copied from interface: Locator
get the 1-based number of the current line.

Specified by:
getLineNumber in interface Locator
Returns:
the line number or -1 if unknown

getLineSegmentEndOffset

public int getLineSegmentEndOffset()
Description copied from interface: Locator
Get the 0-based offset of the end of the current line segment being processed, exclusive. Generally a phrase modifier starts at Locator.getLineCharacterOffset() and ends on the character preceding this offset, [s,e) where s is the start and e is the end.

Specified by:
getLineSegmentEndOffset in interface Locator


Copyright © 2011 FuseSource, Corp.. All Rights Reserved.