Warning
This interface should not be implemented or extended by code outside of this library.
There are two kinds of symbol tables: shared and local. With that, there are two further distinctions of shared symbol tables: system and substitute.
In order to ensure that we retain the correct import declarations, a substitute table is created, substituting the originally matched shared symtab from the catalog. The substitute table in turns exposes the correct name, version and max_id for any callers that require it, and becomes a delegate of the substituted symtab's interface.
Implementations of this interface are safe for use by multiple threads.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | UNKNOWN_SYMBOL_ID
Indicates that a symbol's integer ID could not be determined. |
| Modifier and Type | Method and Description |
|---|---|
| public SymbolToken | |
| public String | Returns: the interned text associated with the symbol ID, ornull if the text is not known.the requested symbol ID. id)Gets the interned text for a symbol ID. |
| public int | Returns: the id of the requested symbol, orUNKNOWN_SYMBOL_ID if it's not defined.must not be null or empty. name)Gets the symbol ID associated with a given symbol name. |
| public int | getImportedMaxId()
Gets the highest symbol id reserved by this table's imports (including system symbols). |
| public SymbolTable[] | Returns: null if this is a shared or system table, otherwise a
non-null but potentially zero-length array of shared tables (but no
system table).Gets the sequence of shared symbol tables imported by this (local) symbol table. |
| public String | Returns: the version identifier; ornull for non-system shared
tables.Gets the identifier for the Ion version (and thus the system symbol table) used by this table. |
| public int | Returns: the largest integer such thatfindKnownSymbol(int) could
return a non-null result. Note that there is no promise
that it will return a name, only that any larger id will not
have a name defined.Gets the highest symbol id reserved by this table. |
| public String | |
| public SymbolTable | Returns: notnull, except for non-system shared tables.Gets the system symbol table being used by this local table. |
| public int | |
| public SymbolToken | |
| public boolean | |
| public boolean | Returns: true if this table is read-only, false if symbols may be added.Determines whether this symbol table can have symbols added to it. |
| public boolean | isSharedTable()
Determines whether this symbol table is shared, and therefore named, versioned, and read-only. |
| public boolean | isSubstitute()
Determines whether this instance is substituting for an imported shared table for which no exact match was found in the catalog. |
| public boolean | isSystemTable()
Determines whether this symbol table is a system symbol table, and therefore shared, named, versioned, and read-only. |
| public Iterator | Returns: a new iterator.Creates an iterator that will return all non-imported symbol names, in order of their symbol IDs. |
| public void | |
| public void |
| UNKNOWN_SYMBOL_ID | back to summary |
|---|---|
| public static final int UNKNOWN_SYMBOL_ID Indicates that a symbol's integer ID could not be determined. That's generally the case when constructing value instances that are not yet contained by a datagram. | |
| find | back to summary |
|---|---|
| public SymbolToken find(String text) Finds a symbol already interned by this table. This method will not necessarily return the same instance given the same input.
| |
| findKnownSymbol | back to summary |
|---|---|
| public String findKnownSymbol(int id) Gets the interned text for a symbol ID.
| |
| findSymbol | back to summary |
|---|---|
| public int findSymbol(String name) Gets the symbol ID associated with a given symbol name.
| |
| getImportedMaxId | back to summary |
|---|---|
| public int getImportedMaxId() Gets the highest symbol id reserved by this table's imports (including system symbols). Any id higher than this value is a local symbol declared by this table. This value is zero for shared symbol tables, since they do not utilize imports. | |
| getImportedTables | back to summary |
|---|---|
| public SymbolTable[] getImportedTables() Gets the sequence of shared symbol tables imported by this (local) symbol table. The result does not include a system table.
If this local table imported a shared table for which the relevant
If this local table imported a shared table for which the relevant
| |
| getIonVersionId | back to summary |
|---|---|
| public String getIonVersionId() Gets the identifier for the Ion version (and thus the system symbol
table) used by this table.
The version identifier is a string of the form
| |
| getMaxId | back to summary |
|---|---|
| public int getMaxId() Gets the highest symbol id reserved by this table.
| |
| getName | back to summary |
|---|---|
| public String getName() Gets the unique name of this symbol table.
| |
| getSystemSymbolTable | back to summary |
|---|---|
| public SymbolTable getSystemSymbolTable() Gets the system symbol table being used by this local table.
If
| |
| getVersion | back to summary |
|---|---|
| public int getVersion() Gets the version of this symbol table.
| |
| intern | back to summary |
|---|---|
| public SymbolToken intern(String text) Adds a new symbol to this table, or finds an existing definition of it.
The resulting This method will not necessarily return the same instance given the same input.
| |
| isLocalTable | back to summary |
|---|---|
| public boolean isLocalTable() Determines whether this symbol table is local, and therefore unnamed and unversioned.
If this method returns | |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly() Determines whether this symbol table can have symbols added to it. Shared symtabs are always read-only. Local symtabs can also be made read-only on demand, which enables some optimizations when writing data but will cause failures if new symbols are encountered.
| |
| isSharedTable | back to summary |
|---|---|
| public boolean isSharedTable() Determines whether this symbol table is shared, and therefore named, versioned, and read-only.
If this method returns | |
| isSubstitute | back to summary |
|---|---|
| public boolean isSubstitute() Determines whether this instance is substituting for an imported shared table for which no exact match was found in the catalog. Such tables are not authoritative and may not even have any symbol text at all (as is the case when no version of an imported table is found). Substitute tables are always shared, non-system tables. | |
| isSystemTable | back to summary |
|---|---|
| public boolean isSystemTable() Determines whether this symbol table is a system symbol table, and therefore shared, named, versioned, and read-only.
If this method returns | |
| iterateDeclaredSymbolNames | back to summary |
|---|---|
| public Iterator Creates an iterator that will return all non-imported symbol names, in
order of their symbol IDs. The iterator will return
The first string returned by the iterator has a symbol ID that is one
more than | |
| makeReadOnly | back to summary |
|---|---|
| public void makeReadOnly() Prevents this symbol table from accepting any more new symbols. Shared symtabs are always read-only. Making a local symtab read-only enables some optimizations when writing data, but will cause failures if new symbols are encountered.
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(IonWriter writer) throws IOException Writes an Ion representation of this symbol table.
| |