Interface NamedTableManager

    • Method Detail

      • newAnonymousTable

        AnonymousTable newAnonymousTable​(int numRows,
                                         int numColumns)
        Create a new anonymous table. This table is not stored in the manager.
        Parameters:
        numRows - number of rows in the table
        numColumns - number of columns in the table
        Returns:
        the new table
      • newCSVTable

        NamedTable newCSVTable​(java.lang.String systemName,
                               java.lang.String userName,
                               java.lang.String fileName)
        Create a new CSV table. This table is stored in the manager but it's contents does only exists in the CSV file. If the CSV file is changed, the contents will be read on the next start of the program.
        Parameters:
        systemName - the system name of the table
        userName - the user name of the table, or null if no user name
        fileName - the file name of the CSV file
        Returns:
        the new table
      • newInternalTable

        NamedTable newInternalTable​(java.lang.String systemName,
                                    java.lang.String userName,
                                    int numRows,
                                    int numColumns)
        Create a new internal named table. This table is stored in the manager together with its contents. Note that a big table will take a lot of space in the panel file since the storage of table data has a lot of overhead. For larger tables, a CSV table is recommended.
        Parameters:
        systemName - the system name of the table
        userName - the user name of the table, or null if no user name
        numRows - number of rows in the table
        numColumns - number of columns in the table
        Returns:
        the new table
      • loadTableFromCSVData

        NamedTable loadTableFromCSVData​(@Nonnull
                                        java.lang.String sys,
                                        @CheckForNull
                                        java.lang.String user,
                                        @Nonnull
                                        java.lang.String text)
                                 throws java.io.IOException
        Load a table from a CSV text.
        Parameters:
        sys - the system name of the new table
        user - the user name of the new table or null if no user name
        text - the CSV text
        Returns:
        the loaded table
        Throws:
        java.io.IOException - in case of an exception
      • loadTableFromCSV

        NamedTable loadTableFromCSV​(@Nonnull
                                    java.lang.String sys,
                                    @CheckForNull
                                    java.lang.String user,
                                    @Nonnull
                                    java.lang.String fileName)
                             throws java.io.IOException
        Load a table from a CSV finle.
        Parameters:
        sys - the system name of the new table
        user - the user name of the new table or null if no user name
        fileName - the file name of the CSV table
        Returns:
        the loaded table
        Throws:
        java.io.IOException - in case of an exception
      • loadTableFromCSV

        NamedTable loadTableFromCSV​(@Nonnull
                                    java.lang.String sys,
                                    @CheckForNull
                                    java.lang.String user,
                                    @Nonnull
                                    java.io.File file)
                             throws java.io.IOException
        Load a table from a CSV finle.
        Parameters:
        file - the CSV file
        sys - the system name of the new table
        user - the user name of the new table or null if no user name
        Returns:
        the loaded table
        Throws:
        java.io.IOException - in case of an exception
      • getNamedTable

        NamedTable getNamedTable​(java.lang.String name)
        Locate via user name, then system name if needed. Does not create a new one if nothing found
        Parameters:
        name - User name or system name to match
        Returns:
        null if no match found
      • getByUserName

        NamedTable getByUserName​(java.lang.String name)
        Locate an existing instance based on a user name.
        Specified by:
        getByUserName in interface Manager<NamedTable>
        Parameters:
        name - System Name of the required NamedBean
        Returns:
        requested NamedBean object or null if none exists
      • getBySystemName

        NamedTable getBySystemName​(java.lang.String name)
        Locate an existing instance based on a system name.
        Specified by:
        getBySystemName in interface Manager<NamedTable>
        Parameters:
        name - System Name of the required NamedBean
        Returns:
        requested NamedBean object or null if none exists
      • getAutoSystemName

        java.lang.String getAutoSystemName()
        Create a new system name for a LogixNG.
        Returns:
        a new system name
      • deleteNamedTable

        void deleteNamedTable​(NamedTable x)
        Delete NamedTable by removing it from the manager.
        Parameters:
        x - the NamedTable to delete
      • printTree

        void printTree​(java.io.PrintWriter writer,
                       java.lang.String indent)
        Print the tree to a stream.
        Parameters:
        writer - the stream to print the tree to
        indent - the indentation of each level
      • printTree

        void printTree​(java.util.Locale locale,
                       java.io.PrintWriter writer,
                       java.lang.String indent)
        Print the tree to a stream.
        Parameters:
        locale - The locale to be used
        writer - the stream to print the tree to
        indent - the indentation of each level