org.eclipse.mylyn.wikitext.core.parser
Interface Locator

All Known Implementing Classes:
ContentState, LocatorImpl, TextileContentState

public interface Locator

An interface that provides information about the location of the current parser activity. Note that parsers may make a best-effort attempt at determining the location.

Author:
David Green

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.
 

Method Detail

getLineNumber

int getLineNumber()
get the 1-based number of the current line.

Returns:
the line number or -1 if unknown

getLineDocumentOffset

int getLineDocumentOffset()
get the 0-based character offset of the current line from the start of the document

Returns:
the offset or -1 if unknown

getDocumentOffset

int getDocumentOffset()
get the 0-based character offset of the current character from the start of the document. Equivalent to getLineDocumentOffset()+getLineCharacterOffset()


getLineLength

int getLineLength()
get the length of the current line in characters, not including the line terminator


getLineCharacterOffset

int getLineCharacterOffset()
get the 0-based offset of the current character in the current line


getLineSegmentEndOffset

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



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