1 19 20 package org.netbeans.editor; 21 22 28 29 public class BaseTokenID implements TokenID { 30 31 private final String name; 32 33 private final int numericID; 34 35 private final TokenCategory category; 36 37 public BaseTokenID(String name) { 38 this(name, 0); 39 } 40 41 public BaseTokenID(String name, int numericID) { 42 this(name, numericID, null); 43 } 44 45 public BaseTokenID(String name, TokenCategory category) { 46 this(name, 0, category); 47 } 48 49 public BaseTokenID(String name, int numericID, TokenCategory category) { 50 this.name = name; 51 this.numericID = numericID; 52 this.category = category; 53 } 54 55 public String getName() { 56 return name; 57 } 58 59 public int getNumericID() { 60 return numericID; 61 } 62 63 public TokenCategory getCategory() { 64 return category; 65 } 66 67 public String toString() { 68 return getName() + ((getCategory() != null) 69 ? (", category=" + getCategory()) : ""); } 71 72 } 73 | Popular Tags |