Extension SDK 10.1.2

oracle.javatools.parser
Class AbstractLexer.DefaultLexerToken

java.lang.Object
  extended byoracle.javatools.parser.AbstractLexer.DefaultLexerToken
All Implemented Interfaces:
LexerToken
Enclosing class:
AbstractLexer

protected static class AbstractLexer.DefaultLexerToken
extends java.lang.Object
implements LexerToken

The DefaultLexerToken just implements a basic LexerToken which stores a token and start/end offsets.


Field Summary
protected  int endOffset
          The ending offset in the text buffer of this token.
protected  int startOffset
          The starting offset in the text buffer of this token.
protected  int token
          The token that was found.
 
Constructor Summary
protected AbstractLexer.DefaultLexerToken()
           
 
Method Summary
 int getEndOffset()
          Fetches the end offset of the token (offset relative to the original ReadTextBuffer being lexed.
 int getStartOffset()
          Fetches the start offset of the token (offset relative to the original ReadTextBuffer being lexed.
 int getToken()
          Fetches the (language-specific) token represented by this LexerToken.
 void setEndOffset(int end)
          Sets the end offset for this token.
 void setStartOffset(int start)
          Sets the starting offset for this token.
 void setToken(int token)
          Set the token of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token

protected int token
The token that was found.


startOffset

protected int startOffset
The starting offset in the text buffer of this token.


endOffset

protected int endOffset
The ending offset in the text buffer of this token.

Constructor Detail

AbstractLexer.DefaultLexerToken

protected AbstractLexer.DefaultLexerToken()
Method Detail

getToken

public int getToken()
Fetches the (language-specific) token represented by this LexerToken. You must refer to the language-specific Lexer that was responsible for filling this LexerToken instance to interpret the token.

Specified by:
getToken in interface LexerToken
Returns:
the lexer token

setToken

public void setToken(int token)
Set the token of this object.

Parameters:
token - the token to set

getStartOffset

public int getStartOffset()
Fetches the start offset of the token (offset relative to the original ReadTextBuffer being lexed. Note that the start offset is inclusive (compare to end offset which is exclusive), to match the behavior in the String class.

Specified by:
getStartOffset in interface LexerToken
Returns:
the starting offset

setStartOffset

public void setStartOffset(int start)
Sets the starting offset for this token.

Parameters:
start - the starting offset

getEndOffset

public int getEndOffset()
Fetches the end offset of the token (offset relative to the original ReadTextBuffer being lexed. Note that the end offset is exclusive (similar to end offsets in the String class.)

Specified by:
getEndOffset in interface LexerToken
Returns:
the ending offset

setEndOffset

public void setEndOffset(int end)
Sets the end offset for this token.

Parameters:
end - the ending offset

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.