Top Description Fields Constructors Methods
com.amazon.ion.impl.bin

pack-priv abstract Class AbstractSymbolTable

extends Object
implements SymbolTable
Class Inheritance
All Implemented Interfaces
com.amazon.ion.SymbolTable
Known Direct Subclasses
com.amazon.ion.impl.bin.IonManagedBinaryWriter.LocalSymbolTableView
Static Imports
com.amazon.ion.IonType.LIST, .IonType.STRUCT, .SystemSymbols.IMPORTS_SID, .SystemSymbols.ION_1_0, .SystemSymbols.ION_SHARED_SYMBOL_TABLE_SID, .SystemSymbols.ION_SYMBOL_TABLE_SID, .SystemSymbols.MAX_ID_SID, .SystemSymbols.NAME_SID, .SystemSymbols.SYMBOLS_SID, .SystemSymbols.VERSION_SID, com.amazon.ion.impl.bin.Symbols.systemSymbol

Provides the basic implementation bits for SymbolTable.

Field Summary

Modifier and TypeField and Description
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
AbstractSymbolTable(final String name, final int version)

Method Summary

Modifier and TypeMethod and Description
public final int
findSymbol(final String
must not be null or empty.
name
)

Implements com.amazon.ion.SymbolTable.findSymbol.

Gets the symbol ID associated with a given symbol name.

public final String
getIonVersionId()

Implements com.amazon.ion.SymbolTable.getIonVersionId.

Gets the identifier for the Ion version (and thus the system symbol table) used by this table.

public final String
getName()

Implements com.amazon.ion.SymbolTable.getName.

Gets the unique name of this symbol table.

public final int
getVersion()

Implements com.amazon.ion.SymbolTable.getVersion.

Gets the version of this symbol table.

public void
makeReadOnly()

Implements com.amazon.ion.SymbolTable.makeReadOnly.

Prevents this symbol table from accepting any more new symbols.

public final void
writeTo(final IonWriter
must not be null.
writer
)

Implements com.amazon.ion.SymbolTable.writeTo.

Writes an Ion representation of this symbol table.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private final String name
versionback to summary
private final int version

Constructor Detail

AbstractSymbolTableback to summary
public AbstractSymbolTable(final String name, final int version)

Method Detail

findSymbolback to summary
public final int findSymbol(final String name)

Implements com.amazon.ion.SymbolTable.findSymbol.

Doc from com.amazon.ion.SymbolTable.findSymbol.

Gets the symbol ID associated with a given symbol name.

Parameters
name:String

must not be null or empty.

Returns:int

the id of the requested symbol, or UNKNOWN_SYMBOL_ID if it's not defined.

getIonVersionIdback to summary
public final String getIonVersionId()

Implements com.amazon.ion.SymbolTable.getIonVersionId.

Doc from com.amazon.ion.SymbolTable.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 "$ion_X_Y".

Returns:String

the version identifier; or null for non-system shared tables.

getNameback to summary
public final String getName()

Implements com.amazon.ion.SymbolTable.getName.

Doc from com.amazon.ion.SymbolTable.getName.

Gets the unique name of this symbol table.

Returns:String

the unique name, or null if isLocalTable().

getVersionback to summary
public final int getVersion()

Implements com.amazon.ion.SymbolTable.getVersion.

Doc from com.amazon.ion.SymbolTable.getVersion.

Gets the version of this symbol table.

Returns:int

at least one, or zero if isLocalTable().

makeReadOnlyback to summary
public void makeReadOnly()

Implements com.amazon.ion.SymbolTable.makeReadOnly.

Doc from com.amazon.ion.SymbolTable.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.

writeToback to summary
public final void writeTo(final IonWriter writer) throws IOException

Implements com.amazon.ion.SymbolTable.writeTo.

Doc from com.amazon.ion.SymbolTable.writeTo.

Writes an Ion representation of this symbol table.

Parameters
writer:IonWriter

must not be null.

Exceptions
IOException:
if thrown by the writer.