Class Column

java.lang.Object
ch.rabanti.nanoxlsx4j.Column

public class Column extends Object
Class representing a column of a worksheet
Author:
Raphael Stoeckli
  • Constructor Details

    • Column

      public Column(String columnAddress)
      Constructor with column address
      Parameters:
      columnAddress - Column address (A to XFD)
    • Column

      public Column(int number)
      Constructor with column number
      Parameters:
      number - Column number (zero-based, 0 to 16383)
  • Method Details

    • setAutoFilter

      public void setAutoFilter(boolean hasAutoFilter)
      Sets whether auto filter is enabled on the column
      Parameters:
      hasAutoFilter - If true, the column has auto filter applied, otherwise not
    • getColumnAddress

      public String getColumnAddress()
      Gets the column address
      Returns:
      Column address (A to XFD)
    • setColumnAddress

      public void setColumnAddress(String columnAddress)
      Sets the column address
      Parameters:
      columnAddress - Column address (A to XFD)
    • getNumber

      public int getNumber()
      Gets the column number
      Returns:
      Column number (0 to 16383)
    • setNumber

      public void setNumber(int number)
      Sets the column number
      Parameters:
      number - Column number (0 to 16383)
    • getWidth

      public float getWidth()
      Gets the width of the column
      Returns:
      Width of the column
    • setWidth

      public void setWidth(float width)
      Sets the width of the column
      Parameters:
      width - Width of the column
    • hasAutoFilter

      public boolean hasAutoFilter()
      Gets whether auto filter is enabled on the column
      Returns:
      If true, the column has auto filter applied, otherwise not
    • isHidden

      public boolean isHidden()
      Gets whether the column is hidden or visible
      Returns:
      If true, the column is hidden, otherwise visible
    • setHidden

      public void setHidden(boolean isHidden)
      Sets whether the column is hidden or visible
      Parameters:
      isHidden - If true, the column is hidden, otherwise visible
    • getDefaultColumnStyle

      public Style getDefaultColumnStyle()
      Gets the default style of the column
      Returns:
      Default style
    • setDefaultColumnStyle

      public Style setDefaultColumnStyle(Style defaultColumnStyle)
      Sets the default style of the column
      Parameters:
      defaultColumnStyle - Style to assign as default column style. Can be null (to clear)
      Returns:
      If the passed style already exists in the repository, the existing one will be returned, otherwise the passed one
    • setDefaultColumnStyle

      public Style setDefaultColumnStyle(Style defaultColumnStyle, boolean unmanaged)
      Sets the default style of the column
      Parameters:
      defaultColumnStyle - Style to assign as default column style. Can be null (to clear)
      unmanaged - Internally used: If true, the style repository is not invoked and only the style object of the column is updated. Do not use!
      Returns:
      If the passed style already exists in the repository, the existing one will be returned, otherwise the passed one