1 19 24 25 package org.netbeans.lib.java.parser; 26 27 31 public final class ScannerToken extends ASTClass implements Token { 32 33 private Token padding[]; 34 private int tokenIndex; 35 private Object value; 36 private int startCharOffset; 37 private int endCharOffset; 38 private boolean deprecatedFlag; 40 public ScannerToken(int t, int start, int end, Token[] pad, int index) { 41 super(null,t); 42 startCharOffset=start; 43 endCharOffset=end; 44 padding=pad; 45 tokenIndex=index; 46 } 47 48 public ScannerToken(int t, Object o, int start, int end, Token[] pad, int index) { 49 this(t,start,end,pad,index); 50 value=o; 51 } 52 53 public ScannerToken(int t, Object o, int start, int end, Token[] pad, int index, boolean deprecated) { 54 this(t,o,start,end,pad,index); 55 deprecatedFlag = deprecated; 56 } 57 58 public ScannerToken(int t, Object o, int start, int end, Token[] pad, int index, boolean deprecated, ASTContext context) { 59 this(t,o,start,end,pad,index, deprecated); 60 setContext(context); 61 } 62 63 int getTokenIndex() { 64 return tokenIndex; 65 } 66 67 void setContext(ASTContext context) { 68 astContext = context; 69 } 70 71 public String toString() { 72 String s="Type "+getType(); 73 74 if (value==null) 75 return s; 76 return s+" :"+value; 77 } 78 79 public int getStartOffset() { 80 return startCharOffset; 81 } 82 83 public int getEndOffset() { 84 return endCharOffset; 85 } 86 87 90 public Token[] getPadding() { 91 return padding; 92 } 93 94 97 public Object getValue() { 98 return value; 99 } 100 101 102 public int getFirstToken() { 103 return tokenIndex; 104 } 105 106 public int getLastToken() { 107 return tokenIndex; 108 } 109 110 public ASTree[] getSubTrees() { 111 return null; 112 } 113 114 122 public boolean getDeprecatedFlag() { 123 return deprecatedFlag; 124 } 125 } 126 | Popular Tags |