com.aptana.ide.editors.unified
Class ChildOffsetMapper

java.lang.Object
  extended by com.aptana.ide.editors.unified.ChildOffsetMapper
All Implemented Interfaces:
IChildOffsetMapper, IOffsetMapper
Direct Known Subclasses:
CSSOffsetMapper, HTMLOffsetMapper, JSOffsetMapper, ScriptDocOffsetMapper

public class ChildOffsetMapper
extends java.lang.Object
implements IChildOffsetMapper

ChildOffsetMapper


Constructor Summary
ChildOffsetMapper(IParentOffsetMapper parent)
          ChildOffsetMapper
 
Method Summary
 void calculateCurrentLexeme(int offset)
          Calculates the index and lexeme that the given offset is within and caches it.
 void dispose()
          Disposes the object.
 ICodeLocation findTarget(Lexeme lexeme)
          findTarget
 Lexeme getCurrentLexeme()
          Gets the cached current Lexeme based on the current offset of the document.
 int getCurrentLexemeIndex()
          Gets the cached current Lexeme index based on the offset in the current document.
 FileService getFileService()
          getFileService
 Lexeme getLexemeAtIndex(int index)
          Gets the lexeme at the specified index.
 int getLexemeIndexFromDocumentOffset(int offset)
          With a name this long you don't really need a comment.
 LexemeList getLexemeList()
          getLexemeList
 Lexeme getNextLexeme()
          Gets the next lexeme based on the current caret position, or null if there is no next lexeme.
 IParentOffsetMapper getParent()
          getParent
 Lexeme getPreviousLexeme()
          Gets the previous lexeme based on the current caret position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildOffsetMapper

public ChildOffsetMapper(IParentOffsetMapper parent)
ChildOffsetMapper

Parameters:
parent -
Method Detail

getParent

public IParentOffsetMapper getParent()
Description copied from interface: IChildOffsetMapper
getParent

Specified by:
getParent in interface IChildOffsetMapper
Returns:
IParentOffsetMapper
See Also:
IChildOffsetMapper.getParent()

calculateCurrentLexeme

public void calculateCurrentLexeme(int offset)
Description copied from interface: IOffsetMapper
Calculates the index and lexeme that the given offset is within and caches it. This accounts for whitespace areas by setting the result to the previous lexeme if available.

Specified by:
calculateCurrentLexeme in interface IOffsetMapper
See Also:
IOffsetMapper.calculateCurrentLexeme(int)

getFileService

public FileService getFileService()
Description copied from interface: IChildOffsetMapper
getFileService

Specified by:
getFileService in interface IChildOffsetMapper
Returns:
FileService
See Also:
IChildOffsetMapper.getFileService()

getCurrentLexeme

public Lexeme getCurrentLexeme()
Description copied from interface: IOffsetMapper
Gets the cached current Lexeme based on the current offset of the document.

Specified by:
getCurrentLexeme in interface IOffsetMapper
Returns:
Returns the current lexeme.
See Also:
IOffsetMapper.getCurrentLexeme()

getCurrentLexemeIndex

public int getCurrentLexemeIndex()
Description copied from interface: IOffsetMapper
Gets the cached current Lexeme index based on the offset in the current document.

Specified by:
getCurrentLexemeIndex in interface IOffsetMapper
Returns:
Returns the current lexeme index.
See Also:
IOffsetMapper.getCurrentLexemeIndex()

getLexemeAtIndex

public Lexeme getLexemeAtIndex(int index)
Description copied from interface: IOffsetMapper
Gets the lexeme at the specified index.

Specified by:
getLexemeAtIndex in interface IOffsetMapper
Returns:
Returns the current lexeme at that index, or null if not found.
See Also:
IOffsetMapper.getLexemeAtIndex(int)

getLexemeIndexFromDocumentOffset

public int getLexemeIndexFromDocumentOffset(int offset)
Description copied from interface: IOffsetMapper
With a name this long you don't really need a comment.

Specified by:
getLexemeIndexFromDocumentOffset in interface IOffsetMapper
Returns:
returns the LexemeIndexFromDocumentOffset
See Also:
IOffsetMapper.getLexemeIndexFromDocumentOffset(int)

getLexemeList

public LexemeList getLexemeList()
Description copied from interface: IOffsetMapper
getLexemeList

Specified by:
getLexemeList in interface IOffsetMapper
Returns:
LexemeList
See Also:
IOffsetMapper.getLexemeList()

getNextLexeme

public Lexeme getNextLexeme()
Gets the next lexeme based on the current caret position, or null if there is no next lexeme.

Returns:
Returns the next lexeme based on the current caret position.

getPreviousLexeme

public Lexeme getPreviousLexeme()
Gets the previous lexeme based on the current caret position.

Returns:
Returns the previous lexeme based on the current caret position.

findTarget

public ICodeLocation findTarget(Lexeme lexeme)
Description copied from interface: IOffsetMapper
findTarget

Specified by:
findTarget in interface IOffsetMapper
Returns:
ICodeLocation
See Also:
IOffsetMapper.findTarget(com.aptana.ide.lexer.Lexeme)

dispose

public void dispose()
Description copied from interface: IOffsetMapper
Disposes the object.

Specified by:
dispose in interface IOffsetMapper
See Also:
IOffsetMapper.dispose()