1 /**
2  *  ServingXML
3  *
4  *  Copyright (C) 2006  Daniel Parker
5  *    daniel.parker@servingxml.com
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  **/
20 
21 package com.servingxml.util;
22 
23 import java.io.PrintStream;
24 
25 /**
26  * Defines an immutable interface for a symbol table of <tt>Name</tt> objects.
27  *
28  *
29  * @author Daniel A. Parker (daniel.parker@servingxml.com)
30  */
31 
32 public interface NameTable {
containsSymbol(int nameSymbol)33   boolean containsSymbol(int nameSymbol);
34 
lookupName(int symbol)35   Name lookupName(int symbol);
36 
lookupSymbol(String namespaceUri, String localName)37   int lookupSymbol(String namespaceUri, String localName);
38 
lookupSymbol(Name name)39   int lookupSymbol(Name name);
40 
size()41   int size();
42 
43   /*
44    *  Prints diagnostics for the name table content
45    */
printDiagnostics(PrintStream printStream)46   void printDiagnostics(PrintStream printStream);
47 
48   /*
49    * Returns a shallow copy of names
50    */
getNames()51   Name[] getNames();
52 
53   /*
54    * Returns a shallow copy of namespaces
55    */
getNamespaces()56   String[] getNamespaces();
57 
getNamespace(int namespaceIndex)58   String getNamespace(int namespaceIndex);
59 }
60