Instances of this class are safe for use by multiple threads.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | DEFAULT_CAPACITY
The initial length of |
| pack-priv static final LocalSymbolTable. | |
| private boolean | isReadOnly
Whether this symbol table is read only, and thus, immutable. |
| pack-priv final int | myFirstLocalSid
The sid of the first local symbol, which is stored at
|
| private final LocalSymbolTableImports | myImportsList
The system and shared symtabs imported by this symtab. |
| pack-priv String[] | mySymbolNames
The local symbol names declared in this symtab; never null. |
| pack-priv int | mySymbolsCount
This is the number of symbols defined in this symbol table locally, that is not imported from some other table. |
| private final Map | mySymbolsMap
Map of symbol names to symbol ids of local symbols that are not in imports. |
| Access | Constructor and Description |
|---|---|
| protected | LocalSymbolTable(LocalSymbolTableImports
never null imports, List<String> may be null or empty symbolsList)
|
| protected | LocalSymbolTable(LocalSymbolTable other, int maxId)
Copy-constructor, performs defensive copying of member fields where necessary. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public SymbolToken | find(String
the symbol text to find. text)Implements com. Finds a symbol already interned by this table. |
| public String | findKnownSymbol(int
the requested symbol ID. id)Implements com. Gets the interned text for a symbol ID. |
| private int | |
| public int | findSymbol(String
must not be null or empty. name)Implements com. Gets the symbol ID associated with a given symbol name. |
| public int | getImportedMaxId()
Implements com. Gets the highest symbol id reserved by this table's imports (including system symbols). |
| public SymbolTable[] | getImportedTables()
Implements com. Gets the sequence of shared symbol tables imported by this (local) symbol table. |
| public SymbolTable[] | getImportedTablesNoCopy()
Implements com. Returns the imported symbol tables without making a copy. |
| public String | getIonVersionId()
Implements com. Gets the identifier for the Ion version (and thus the system symbol table) used by this table. |
| public synchronized int | getMaxId()
Implements com. Gets the highest symbol id reserved by this table. |
| public String | |
| public SymbolTable | getSystemSymbolTable()
Implements com. Gets the system symbol table being used by this local table. |
| public int | getVersion()
Implements com. Gets the version of this symbol table. |
| public synchronized SymbolToken | intern(String
the symbol text to intern. text)Implements com. Adds a new symbol to this table, or finds an existing definition of it. |
| public boolean | isLocalTable()
Implements com. Determines whether this symbol table is local, and therefore unnamed and unversioned. |
| public synchronized boolean | isReadOnly()
Implements com. Determines whether this symbol table can have symbols added to it. |
| public boolean | isSharedTable()
Implements com. Determines whether this symbol table is shared, and therefore named, versioned, and read-only. |
| public boolean | isSubstitute()
Implements com. Determines whether this instance is substituting for an imported shared table for which no exact match was found in the catalog. |
| public boolean | isSystemTable()
Implements com. Determines whether this symbol table is a system symbol table, and therefore shared, named, versioned, and read-only. |
| public synchronized Iterator | iterateDeclaredSymbolNames()
Implements com. Creates an iterator that will return all non-imported symbol names, in order of their symbol IDs. |
| public synchronized _Private_LocalSymbolTable | |
| pack-priv synchronized LocalSymbolTable | |
| public synchronized void | makeReadOnly()
Implements com. Prevents this symbol table from accepting any more new symbols. |
| private static void | prepImportsList(List<SymbolTable> importsList, IonReader reader, IonCatalog catalog)
Collects the necessary imports from the reader and catalog, and load
them into the passed-in |
| pack-priv int | |
| private static void | |
| protected static LocalSymbolTableImports | Returns: a new LocalSymbolTableImports instance, or null if this was an LST append. If null, `currentSymbolTable` continues to be the active symbol table.the reader from which to parse the symbol table. reader, IonCatalog the catalog from which to resolve shared symbol table imports. catalog, boolean true if the reader is already positioned on the symbol table struct; otherwise, false. isOnStruct, List<String> list into which local symbols declared by the parsed symbol table will be deposited. symbolsListOut, SymbolTable the symbol table currently active in the stream. currentSymbolTable)Parses the symbol table at the reader's current position. |
| private static SymbolTable | Returns: symbol table representation of the import; null if the import declaration is malformedReturns a |
| pack-priv boolean | symtabExtends(SymbolTable other)
This method, and the context from which it is called, assumes that the symtabs are not being mutated by another thread. |
| public String | |
| public static String | Returns: the symbol name, of the form$NNN where NNN is the
integer rendering of idmust be a value greater than zero. id)Generate the string representation of a symbol with an unknown id. |
| private static final void | |
| public void | writeTo(IonWriter
must not be null. writer)Implements com. Writes an Ion representation of this symbol table. |
| DEFAULT_CAPACITY | back to summary |
|---|---|
| private static final int DEFAULT_CAPACITY The initial length of | |
| DEFAULT_LST_FACTORY | back to summary |
|---|---|
| pack-priv static final LocalSymbolTable. | |
| isReadOnly | back to summary |
|---|---|
| private boolean isReadOnly Whether this symbol table is read only, and thus, immutable. | |
| myFirstLocalSid | back to summary |
|---|---|
| pack-priv final int myFirstLocalSid The sid of the first local symbol, which is stored at
| |
| myImportsList | back to summary |
|---|---|
| private final LocalSymbolTableImports myImportsList The system and shared symtabs imported by this symtab. Never null. Note this member field is immutable and assigned only during construction, hence no synchronization is needed for its method calls. | |
| mySymbolNames | back to summary |
|---|---|
| pack-priv String[] mySymbolNames The local symbol names declared in this symtab; never null.
The sid of the first element is | |
| mySymbolsCount | back to summary |
|---|---|
| pack-priv int mySymbolsCount This is the number of symbols defined in this symbol table locally, that is not imported from some other table. | |
| mySymbolsMap | back to summary |
|---|---|
| private final Map<String, Integer> mySymbolsMap Map of symbol names to symbol ids of local symbols that are not in imports. | |
| LocalSymbolTable | back to summary |
|---|---|
protected LocalSymbolTable(LocalSymbolTableImports imports, List<String> symbolsList)
| |
| LocalSymbolTable | back to summary |
|---|---|
| protected LocalSymbolTable(LocalSymbolTable other, int maxId) Copy-constructor, performs defensive copying of member fields where necessary. The returned instance is mutable. | |
| buildSymbolsMap | back to summary |
|---|---|
| private void buildSymbolsMap() | |
| find | back to summary |
|---|---|
| public SymbolToken find(String text) Implements com. Doc from com. 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) Implements com. Doc from com. Gets the interned text for a symbol ID.
| |
| findLocalSymbol | back to summary |
|---|---|
| private int findLocalSymbol(String name) | |
| findSymbol | back to summary |
|---|---|
| public int findSymbol(String name) Implements com. Doc from com. Gets the symbol ID associated with a given symbol name.
| |
| getImportedMaxId | back to summary |
|---|---|
| public int getImportedMaxId() Implements com. Doc from com. 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() Implements com. Doc from com. 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
| |
| getImportedTablesNoCopy | back to summary |
|---|---|
| public SymbolTable[] getImportedTablesNoCopy() Implements com. Doc from com. Returns the imported symbol tables without making a copy. Note Callers must not modify the resulting SymbolTable array! This will violate the immutability property of this class.
| |
| getIonVersionId | back to summary |
|---|---|
| public String getIonVersionId() Implements com. Doc from com. 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 synchronized int getMaxId() Implements com. Doc from com. Gets the highest symbol id reserved by this table.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements com. Doc from com. Gets the unique name of this symbol table.
| |
| getSystemSymbolTable | back to summary |
|---|---|
| public SymbolTable getSystemSymbolTable() Implements com. Doc from com. Gets the system symbol table being used by this local table.
If
| |
| getVersion | back to summary |
|---|---|
| public int getVersion() Implements com. Doc from com. Gets the version of this symbol table.
| |
| intern | back to summary |
|---|---|
| public synchronized SymbolToken intern(String text) Implements com. Doc from com. 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() Implements com. Doc from com. Determines whether this symbol table is local, and therefore unnamed and unversioned.
If this method returns | |
| isReadOnly | back to summary |
|---|---|
| public synchronized boolean isReadOnly() Implements com. Doc from com. 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() Implements com. Doc from com. 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() Implements com. Doc from com. 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() Implements com. Doc from com. 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 synchronized Iterator Implements com. Doc from com. 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 | |
| makeCopy | back to summary |
|---|---|
| public synchronized _Private_LocalSymbolTable makeCopy() Implements com.
| |
| makeCopy | back to summary |
|---|---|
| pack-priv synchronized LocalSymbolTable makeCopy(int maxId) | |
| makeReadOnly | back to summary |
|---|---|
| public synchronized void makeReadOnly() Implements com. Doc from com. 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. | |
| prepImportsList | back to summary |
|---|---|
| private static void prepImportsList(List<SymbolTable> importsList, IonReader reader, IonCatalog catalog) Collects the necessary imports from the reader and catalog, and load
them into the passed-in | |
| putSymbol | back to summary |
|---|---|
| pack-priv int putSymbol(String symbolName) NOT SYNCHRONIZED! Call within constructor or from synch'd method. | |
| putToMapIfNotThere | back to summary |
|---|---|
| private static void putToMapIfNotThere(Map<String, Integer> symbolsMap, String text, int sid) | |
| readLocalSymbolTable | back to summary |
|---|---|
| protected static LocalSymbolTableImports readLocalSymbolTable(IonReader reader, IonCatalog catalog, boolean isOnStruct, List<String> symbolsListOut, SymbolTable currentSymbolTable) Parses the symbol table at the reader's current position.
| |
| readOneImport | back to summary |
|---|---|
| private static SymbolTable readOneImport(IonReader ionRep, IonCatalog catalog) Returns a
| |
| symtabExtends | back to summary |
|---|---|
| pack-priv boolean symtabExtends(SymbolTable other) This method, and the context from which it is called, assumes that the symtabs are not being mutated by another thread. Therefore it doesn't use synchronization. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| unknownSymbolName | back to summary |
|---|---|
| public static String unknownSymbolName(int id) Generate the string representation of a symbol with an unknown id.
| |
| validateSymbol | back to summary |
|---|---|
| private static final void validateSymbol(String name) | |
| writeTo | back to summary |
|---|---|
| public void writeTo(IonWriter writer) throws IOException Implements com. Doc from com. Writes an Ion representation of this symbol table.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public SymbolTable | newLocalSymtab(IonCatalog
the catalog containing shared symtabs referenced by import
declarations within the local symtab catalog, IonReader the reader positioned on the local symbol table represented as
a struct reader, boolean denotes whether the reader is already positioned on the struct;
false if it is positioned before the struct alreadyInStruct)Implements com. Constructs a new local symbol table represented by the current value of
the passed in |
| public SymbolTable | newLocalSymtab(SymbolTable
the default system symtab, which will be used if the first
import in defaultSystemSymtab, SymbolTable... imports isn't a system symtab, never nullthe set of shared symbol tables to import; the first (and only
the first) may be a system table, in which case the
imports)defaultSystemSymtab is ignoredImplements com. Constructs a new local symtab with given imports and local symbols. |
| Factory | back to summary |
|---|---|
| private Factory() | |
| newLocalSymtab | back to summary |
|---|---|
| public SymbolTable newLocalSymtab(IonCatalog catalog, IonReader reader, boolean alreadyInStruct) Implements com. Doc from com. Constructs a new local symbol table represented by the current value of
the passed in Note It is assumed that the passed in reader is positioned
properly on/before a value that represents a local symtab semantically.
That is, no exception-checks are made on the
| |
| newLocalSymtab | back to summary |
|---|---|
| public SymbolTable newLocalSymtab(SymbolTable defaultSystemSymtab, SymbolTable... imports) Implements com. Doc from com. Constructs a new local symtab with given imports and local symbols.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final String[] | |
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public String | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| _idx | back to summary |
|---|---|
| private int _idx | |
| mySymbolNames | back to summary |
|---|---|
| private final String[] mySymbolNames | |
| mySymbolsCount | back to summary |
|---|---|
| private final int mySymbolsCount | |
| SymbolIterator | back to summary |
|---|---|
| pack-priv SymbolIterator(String[] symbolNames, int count) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public String next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |