Class SimpleCatalog

    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleCatalog()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SymbolTable getTable​(java.lang.String name)
      Gets a symbol table with a specific name and the highest version possible.
      SymbolTable getTable​(java.lang.String name, int version)
      Gets a desired symbol table from this catalog, using an exact match if possible.
      java.util.Iterator<SymbolTable> iterator()
      Constructs an iterator that enumerates all of the shared symbol tables in this catalog, at the time of method invocation.
      void putTable​(SymbolTable table)
      Adds a symbol table to this catalog.
      SymbolTable removeTable​(java.lang.String name, int version)
      Removes a symbol table from this catalog.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • SimpleCatalog

        public SimpleCatalog()
    • Method Detail

      • getTable

        public SymbolTable getTable​(java.lang.String name)
        Description copied from interface: IonCatalog
        Gets a symbol table with a specific name and the highest version possible.
        Specified by:
        getTable in interface IonCatalog
        Parameters:
        name - identifies the desired symbol table.
        Returns:
        a shared symbol table with the given name, or null if this catalog has no table with the name.
      • getTable

        public SymbolTable getTable​(java.lang.String name,
                                    int version)
        Description copied from interface: IonCatalog
        Gets a desired symbol table from this catalog, using an exact match if possible.

        Implentations must make a best effort to find an exact match. If an exact match cannot be found, then this method must make a best effort to find the best match available.

        Specified by:
        getTable in interface IonCatalog
        Returns:
        the shared symbol table with the given name and version, when an exact match is possible. Otherwise, returns the lowest possible version larger than requested. Otherwise, return the largest possible version lower than requested. If no table with the name can be found, then this method returns null.
      • putTable

        public void putTable​(SymbolTable table)
        Description copied from interface: IonMutableCatalog
        Adds a symbol table to this catalog. This interface does not define the behavior of this method if this catalog already contains a table with the same name and version.
        Specified by:
        putTable in interface IonMutableCatalog
        Parameters:
        table - must be shared but not a system table or substitute table.
      • removeTable

        public SymbolTable removeTable​(java.lang.String name,
                                       int version)
        Removes a symbol table from this catalog.
        Returns:
        the removed table, or null if this catalog has no matching table.
      • iterator

        public java.util.Iterator<SymbolTable> iterator()
        Constructs an iterator that enumerates all of the shared symbol tables in this catalog, at the time of method invocation. The result represents a snapshot of the state of this catalog.
        Specified by:
        iterator in interface java.lang.Iterable<SymbolTable>
        Returns:
        a non-null, but potentially empty, iterator.