| 
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.javatools.parser.java.v2.scanner.TokenArray
public final class TokenArray
A precalculated array of tokens. Pay the cost of lexing the first time in order to calculate the array of tokens. All subsequent lexing is a matter of array accesses.
| Field Summary | |
|---|---|
 int | 
tokenCount
The number of tokens.  | 
 int[] | 
tokenEnds
The (dense) array of token end offsets.  | 
 int[] | 
tokenStarts
The (dense) array of token start offsets.  | 
 short[] | 
tokenValues
The (dense) array of token values.  | 
| Constructor Summary | |
|---|---|
TokenArray(FastLexer lexer)
 | 
|
| Method Summary | |
|---|---|
 void | 
adjust(int offset)
Adjusts every offset in the token array by the given parameter.  | 
 int | 
offset2index(int query,
             boolean biasAfter)
Translates a TextBuffer offset into a TokenArray index with the given bias.  | 
 int | 
search(int query)
 | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public final int tokenCount
public final short[] tokenValues
public final int[] tokenStarts
public final int[] tokenEnds
| Constructor Detail | 
|---|
public TokenArray(FastLexer lexer)
| Method Detail | 
|---|
public void adjust(int offset)
public int search(int query)
query - The start offset to be searched for.
java.lang.ArrayIndexOutOfBoundsException - Only if Arrays.binarySearch
                                        is wrong or if my array data
                                        got corrupted.
public int offset2index(int query,
                        boolean biasAfter)
query - The offset to be searched for.biasAfter - True means use an after-bias. Otherwise,
                  use a before-bias. After-bias means choose the
                  next token. Before-bias means choose the previous.
  | 
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||