Class ImmutableListHeaderTable<T>

    • Method Detail

      • hasColumn

        public boolean hasColumn​(String column)
        Description copied from interface: IHeaderTable
        Checks if the table has a column with the given name.
        Specified by:
        hasColumn in interface IHeaderTable<T>
        Overrides:
        hasColumn in class AbstractHeaderTable<T>
        Parameters:
        column - The name of the column.
        Returns:
        true if the table has a column with the given name, false otherwise.
      • fromRows

        public static <T> IHeaderTable<T> fromRows​(Iterable<? extends Iterable<? extends T>> rows)
        Creates a new table from the given rows of cell values. Uses the column index as the header name. Fills missing cells with null.
        Type Parameters:
        T - The type of the cell values.
        Parameters:
        rows - The rows of cell values.
        Returns:
        A new table from the given rows of cell values.
      • fromRows

        public static <T> IHeaderTable<T> fromRows​(Iterable<? extends Iterable<? extends T>> rows,
                                                   Supplier<? extends T> defaultValue)
        Creates a new table from the given rows of cell values. Uses the column index as the header name. Fills missing cells with the given default value.
        Type Parameters:
        T - The type of the cell values.
        Parameters:
        rows - The rows of cell values.
        defaultValue - Supplier for the default value for missing cells. When null, null is used as the default value.
        Returns:
        A new table from the given rows of cell values.
      • fromRows

        public static IHeaderTable<String> fromRows​(Iterable<? extends Iterable<String>> rows,
                                                    Supplier<String> defaultValue,
                                                    boolean firstRowIsHeader)
        Creates a new table from the given rows of cell values. Uses the first row as the names for the header when the first-row-is-header flag is true. Otherwise, uses the column index as the header name. Fills missing cells with the given default value.
        Parameters:
        rows - The rows of cell values.
        defaultValue - Supplier for the default value for missing cells. When null, null is used as the default value.
        Returns:
        A new table from the given rows of cell values.
      • fromRows

        public static <T> IHeaderTable<T> fromRows​(Iterable<? extends Iterable<? extends T>> rows,
                                                   Supplier<? extends T> defaultValue,
                                                   Function<? super T,​String> headerNameExtractor)
        Creates a new table from the given rows of cell values. When the given header name extractor is non-null, uses the first row as the names for the header. Otherwise, uses the column index as the header name. Fills missing cells with the given default value.
        Type Parameters:
        T - The type of the cell values.
        Parameters:
        rows - The rows of cell values.
        defaultValue - Supplier for the default value for missing cells. When null, null is used as the default value.
        headerNameExtractor - Extractor for the header name. When null, the column index is used as the header name.
        Returns:
        A new table from the given rows of cell values.