# Class CarSection

java.lang.Object
com.codename1.car.CarSection

public class CarSection extends Object
A titled group of `CarRow`s within a `CarListTemplate`. Maps to a sectioned list (`androidx.app.car` `ItemList` with a header / `CPListSection`). The header may be null for an untitled section.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CarSection()`
  Creates an untitled section.
  `CarSection(String header)`
  Creates a section with the supplied header.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CarSection`
  `addRow(CarRow row)`
  Appends a row to the section.
  `String`
  `getHeader()`
  Returns the section header, or null.
  `List<CarRow>`
  `getRows()`
  Returns the rows in this section, in order.
  `CarSection`
  `setHeader(String header)`
  Sets the section header.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CarSection

    public CarSection()
    Creates an untitled section.

  - ### CarSection

    public CarSection(String header)

    Creates a section with the supplied header.

    ###### Parameters

    - `header`: the section header, or null

- ## Method Details

  - ### getHeader

    public String getHeader()
    Returns the section header, or null.

  - ### setHeader

    public CarSection setHeader(String header)

    Sets the section header.

    ###### Parameters

    - `header`: the header text, or null for an untitled section

    ###### Returns

    this section, for chaining

  - ### addRow

    public CarSection addRow(CarRow row)

    Appends a row to the section.

    ###### Parameters

    - `row`: the row to add

    ###### Returns

    this section, for chaining

  - ### getRows

    public List<CarRow> getRows()
    Returns the rows in this section, in order.