Class CliAbstractTable

    • Field Detail

      • readerOffset

        protected long readerOffset
      • numRows

        protected int numRows
      • strings

        protected java.util.List<java.lang.Integer> strings
      • blobs

        protected java.util.List<java.lang.Integer> blobs
      • userStrings

        protected java.util.List<java.lang.Integer> userStrings
    • Constructor Detail

      • CliAbstractTable

        public CliAbstractTable​(BinaryReader reader,
                                CliStreamMetadata metadataStream,
                                CliTypeTable tableType)
        Creates a new generic CLI metadata table. This is intended to be called by a subclass metadata table during its creation.
        Parameters:
        reader - A reader that is used to read the table.
        metadataStream - The metadata stream that the table lives in.
        tableType - The type of table to create.
    • Method Detail

      • getTableType

        public CliTypeTable getTableType()
        Gets this table's table type.
        Returns:
        This table's table type.
      • getNumRows

        public int getNumRows()
        Gets the number of rows in this table. return The number of rows in this table.
      • getRowSize

        public int getRowSize()
        Gets the size in bytes of a row in this table. return The size in bytes of a row in this table.
      • getTableSize

        public int getTableSize()
        Gets the size in bytes of this table.
        Returns:
        The size in bytes of this table.
      • getRow

        public CliAbstractTableRow getRow​(int rowIndex)
                                   throws java.lang.IndexOutOfBoundsException
        Gets the row at the given index.

        NOTE: Per ISO/IEC 23271:2012(E) III.1.9, Row indices start from 1, while heap/stream indices start from 0.

        Parameters:
        rowIndex - The index of the row to get (starting at 1).
        Returns:
        The row at the given index.
        Throws:
        java.lang.IndexOutOfBoundsException - if the row index is invalid.
      • getRowDataType

        public abstract DataType getRowDataType()
        Gets the data type of a row in this table.
        Returns:
        The data type of a row in this table.
      • toDataType

        public DataType toDataType()
        Description copied from interface: StructConverter
        Returns a structure datatype representing the contents of the implementor of this interface.

        For example, given:

         class A {
             int foo;
             double bar;
         }
         

        The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.

        Specified by:
        toDataType in interface StructConverter
        Returns:
        returns a structure datatype representing the implementor of this interface
        See Also:
        StructureDataType
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • readBlobIndex

        protected int readBlobIndex​(BinaryReader reader)
                             throws java.io.IOException
        Reads the blob index that the reader is positioned at.
        Parameters:
        reader - A reader that is positioned at the blob index to read.
        Returns:
        The blob index that the reader is positioned at.
        Throws:
        java.io.IOException - if there is a problem reading the blob index.
      • readStringIndex

        protected int readStringIndex​(BinaryReader reader)
                               throws java.io.IOException
        Reads the string index that the reader is positioned at.
        Parameters:
        reader - A reader that is positioned at the string index to read.
        Returns:
        The string index that the reader is positioned at.
        Throws:
        java.io.IOException - if there is a problem reading the string index.
      • readGuidIndex

        protected int readGuidIndex​(BinaryReader reader)
                             throws java.io.IOException
        Reads the GUID index that the reader is positioned at.
        Parameters:
        reader - A reader that is positioned at the GUID index to read.
        Returns:
        The GUID index that the reader is positioned at.
        Throws:
        java.io.IOException - if there is a problem reading the GUID index.
      • readTableIndex

        protected int readTableIndex​(BinaryReader reader,
                                     CliTypeTable table)
                              throws java.io.IOException
        Reads the table index that the reader is positioned at.
        Parameters:
        reader - A reader that is positioned at the table index to read.
        Returns:
        The table index that the reader is positioned at.
        Throws:
        java.io.IOException - if there is a problem reading the table index.
      • getRowRepresentationSafe

        protected java.lang.String getRowRepresentationSafe​(CliTypeTable table,
                                                            int index)
        Convenience method for getting the row representation of a table.
        Parameters:
        table - The table that has the row.
        index - The index of the row.
        Returns:
        The row representation of a table.
      • getRowShortRepSafe

        protected java.lang.String getRowShortRepSafe​(CliTypeTable otherTable,
                                                      int index)
        Convenience method for getting a safe row representation of a table.
        Parameters:
        otherTable - The table that has the row.
        index - The index of the row.
        Returns:
        The safe row representation of a table.