01: /*
02: * Sun Public License Notice
03: *
04: * The contents of this file are subject to the Sun Public License
05: * Version 1.0 (the "License"). You may not use this file except in
06: * compliance with the License. A copy of the License is available at
07: * http://www.sun.com/
08: *
09: * The Original Code is NetBeans. The Initial Developer of the Original
10: * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11: * Microsystems, Inc. All Rights Reserved.
12: */
13:
14: package org.netbeans.editor;
15:
16: /**
17: * Base implementation of the token category.
18: *
19: * @author Miloslav Metelka
20: * @version 1.00
21: */
22:
23: public class BaseTokenCategory implements TokenCategory {
24:
25: private final String name;
26:
27: private final int numericID;
28:
29: public BaseTokenCategory(String name) {
30: this (name, 0);
31: }
32:
33: public BaseTokenCategory(String name, int numericID) {
34: this .name = name;
35: this .numericID = numericID;
36: }
37:
38: /** Get the name of the category. */
39: public String getName() {
40: return name;
41: }
42:
43: /**
44: * Get the optional numeric identification of this token-category. It can
45: * help to use the category in switch-case statements. It should default to
46: * a zero if no numeric-id should be used.
47: */
48: public int getNumericID() {
49: return numericID;
50: }
51:
52: public String toString() {
53: return getName();
54: }
55:
56: }
|