Class StoragePanel.TableModel

    • Field Detail

      • m_Storage

        protected Storage m_Storage
        the underlying storage.
      • m_HasCacheData

        protected boolean m_HasCacheData
        whether cache data is available.
      • m_Data

        protected String[][] m_Data
        the converted storage.
    • Constructor Detail

      • TableModel

        public TableModel()
        Initializes the table model with no data.
      • TableModel

        public TableModel​(Storage storage)
        Initializes the table model the supplied storage.
        Parameters:
        storage - the storage to display
    • Method Detail

      • getClassString

        protected String getClassString​(Object obj)
        Generates the class string to display.
        Parameters:
        obj - the object to create the string for
        Returns:
        the generated class string
      • initialize

        protected void initialize()
        Initializes the model.
      • hasCaches

        protected boolean hasCaches​(Storage storage)
        Checks whether any cache data is to be displayed.
        Parameters:
        storage - the storage to inspect
        Returns:
        true if cache data present
      • takeSnapshot

        protected String[][] takeSnapshot​(Storage storage)
        Takes a snapshot of the storage and turns it into a string array.
        Parameters:
        storage - the storage to use
        Returns:
        the snapshot
      • hasCacheData

        public boolean hasCacheData()
        Returns whether cache data is present.
        Returns:
        true if cache data present (3 columns instead of 2)
      • getObject

        public Object getObject​(String cache,
                                String key)
        Returns the object associated with the specified key.
        Parameters:
        cache - the cache to access, use null or empty string if regular storage
        key - the key for the object to retrieve
        Returns:
        the associated object, null if not found
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the model.
        Returns:
        always 3
      • getRowCount

        public int getRowCount()
        Returns the number of rows.
        Returns:
        the number of rows
      • getValueAt

        public Object getValueAt​(int rowIndex,
                                 int columnIndex)
        Returns the value at the specified position.
        Parameters:
        rowIndex - the row of the cell
        columnIndex - the column of the cell
        Returns:
        the value
      • setValueAt

        public void setValueAt​(Object aValue,
                               int rowIndex,
                               int columnIndex)
        Sets the value at the specified position.
        Specified by:
        setValueAt in interface TableModel
        Overrides:
        setValueAt in class AbstractTableModel
        Parameters:
        aValue - the value to set
        rowIndex - the row of the cell
        columnIndex - the column of the cell
      • isDifferent

        public boolean isDifferent​(Storage other)
        Checks whether the storage contains different data.
        Parameters:
        other - the other storage to compare with
        Returns:
        true if different