Instances of this class are safe for use by multiple threads.
| Modifier and Type | Field and Description |
|---|---|
| private static final SymbolTable | ION_1_0_SYSTEM_SYMTAB
The singleton instance of Ion 1.0 system symbol table. |
| private final String | myName
The name of this shared symbol table. |
| private final String[] | mySymbolNames
The names (aka text) of declared symbols in this shared symbol table (that are not imported from some other symbol table); never null. |
| private final Map | mySymbolsMap
Map of symbol names to symbol ids of declared symbols. |
| private final int | myVersion
The version of this shared symbol table. |
| private static final String[] | SYSTEM_SYMBOLS
The array of system symbols as defined by Ion 1.0. |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| 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. |
| 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 String | getIonVersionId()
Implements com. Gets the identifier for the Ion version (and thus the system symbol table) used by this table. |
| public int | getMaxId()
Implements com. Gets the highest symbol id reserved by this table. |
| public String | |
| pack-priv static SymbolTable | getSystemSymbolTable(int
the specified version of the system symbol table; currently,
only version 1 (Ion 1.0) is supported version)Gets a specific version of the system symbol table. |
| 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 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 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 Iterator | iterateDeclaredSymbolNames()
Implements com. Creates an iterator that will return all non-imported symbol names, in order of their symbol IDs. |
| public void | makeReadOnly()
Implements com. Prevents this symbol table from accepting any more new symbols. |
| pack-priv static SymbolTable | newSharedSymbolTable(String
the name of the new shared symbol table name, int the version of the new shared symbol table version, SymbolTable may be null priorSymtab, Iterator<String> never null symbols)Constructs a new shared symbol table from the parameters. |
| pack-priv static SymbolTable | newSharedSymbolTable(IonStruct
the ionRep)IonStruct representing the new shared symbol tableConstructs a new shared symbol table represented by the passed in
|
| pack-priv static SymbolTable | newSharedSymbolTable(IonReader reader, boolean
denotes whether the isOnStruct)IonReader is already positioned on
the struct; false if it is positioned before the structConstructs a new shared symbol table represented by the current value
of the passed in |
| private static void | prepSymbolsListAndMap(SymbolTable priorSymtab, Iterator<String> symbols, List<String> symbolsList, Map<String, Integer> symbolsMap)
Collects the necessary symbols from |
| private static void | |
| private static void | |
| public void | writeTo(IonWriter
must not be null. writer)Implements com. Writes an Ion representation of this symbol table. |
| ION_1_0_SYSTEM_SYMTAB | back to summary |
|---|---|
| private static final SymbolTable ION_1_0_SYSTEM_SYMTAB The singleton instance of Ion 1.0 system symbol table. TODO amazon-ion/ion-java/issues/34 Optimize system symtabs by using our custom backing impl. | |
| myName | back to summary |
|---|---|
| private final String myName The name of this shared symbol table. If this is a system symbol
table, it is | |
| mySymbolNames | back to summary |
|---|---|
| private final String[] mySymbolNames The names (aka text) of declared symbols in this shared symbol table (that are not imported from some other symbol table); never null. The sid of the first element is 1. Note that null references are valid elements within this member field, denoting undefined symbol IDs ("gaps"). | |
| mySymbolsMap | back to summary |
|---|---|
| private final Map<String, Integer> mySymbolsMap Map of symbol names to symbol ids of declared symbols. | |
| myVersion | back to summary |
|---|---|
| private final int myVersion The version of this shared symbol table. | |
| SYSTEM_SYMBOLS | back to summary |
|---|---|
| private static final String[] SYSTEM_SYMBOLS The array of system symbols as defined by Ion 1.0. | |
| SharedSymbolTable | back to summary |
|---|---|
| private SharedSymbolTable(String name, int version, List<String> symbolsList, Map<String, Integer> symbolsMap) | |
| SharedSymbolTable | back to summary |
|---|---|
| private SharedSymbolTable(String name, int version, String[] symbolNames, Map<String, Integer> symbolsMap) | |
| 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.
| |
| 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
| |
| 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 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 |
|---|---|
| pack-priv static SymbolTable getSystemSymbolTable(int version) Gets a specific version of the system 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 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 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 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 | |
| makeReadOnly | back to summary |
|---|---|
| public 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. | |
| newSharedSymbolTable | back to summary |
|---|---|
| pack-priv static SymbolTable newSharedSymbolTable(String name, int version, SymbolTable priorSymtab, Iterator<String> symbols) Constructs a new shared symbol table from the parameters.
As per Therefore, THIS METHOD IS NOT SUITABLE WHEN READING SERIALIZED SHARED SYMBOL TABLES since that scenario must preserve all sids.
| |
| newSharedSymbolTable | back to summary |
|---|---|
| pack-priv static SymbolTable newSharedSymbolTable(IonStruct ionRep) Constructs a new shared symbol table represented by the passed in
| |
| newSharedSymbolTable | back to summary |
|---|---|
| pack-priv static SymbolTable newSharedSymbolTable(IonReader reader, boolean isOnStruct) Constructs a new shared symbol table represented by the current value
of the passed in | |
| prepSymbolsListAndMap | back to summary |
|---|---|
| private static void prepSymbolsListAndMap(SymbolTable priorSymtab, Iterator<String> symbols, List<String> symbolsList, Map<String, Integer> symbolsMap) Collects the necessary symbols from | |
| putToMapIfNotThere | back to summary |
|---|---|
| private static void putToMapIfNotThere(Map<String, Integer> symbolsMap, String text, int sid) | |
| transferNonExistingSymbols | back to summary |
|---|---|
| private static void transferNonExistingSymbols(List<String> symbolsList, Map<String, Integer> symbolsMap) Transfer symbols from | |
| writeTo | back to summary |
|---|---|
| public void writeTo(IonWriter writer) throws IOException Implements com. Doc from com. Writes an Ion representation of this symbol table.
| |