1 19 20 package org.netbeans.api.lexer; 21 22 50 51 public abstract class Token<T extends TokenId> { 52 53 58 protected Token() { 59 if (!(this instanceof org.netbeans.lib.lexer.token.AbstractToken)) { 60 throw new IllegalStateException ("Custom token implementations prohibited."); } 62 } 63 64 69 public abstract T id(); 70 71 116 public abstract CharSequence text(); 117 118 132 public abstract boolean isCustomText(); 133 134 146 public abstract int length(); 147 148 176 public abstract int offset(TokenHierarchy<?> tokenHierarchy); 177 178 196 public abstract boolean isFlyweight(); 197 198 202 public abstract PartType partType(); 203 204 211 public abstract boolean isPreprocessedText(); 212 213 217 public abstract CharSequence preprocessedText(); 218 219 223 public abstract String preprocessError(); 224 225 232 public abstract int preprocessErrorIndex(); 233 234 237 public abstract boolean hasProperties(); 238 239 251 public abstract Object getProperty(Object key); 252 253 257 public final int hashCode() { 258 return super.hashCode(); 259 } 260 261 265 public final boolean equals(Object o) { 266 return super.equals(o); 267 } 268 269 } 270 | Popular Tags |